From af89cb0af5a2ac8364b4fd39ad1ad63eae0eb122 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 29 Aug 2023 15:58:24 +0800 Subject: [PATCH] fix:memory error --- examples/c/prepare.c | 2 +- utils/test/c/varbinary_test.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/c/prepare.c b/examples/c/prepare.c index fce12885c5..a91153a92f 100644 --- a/examples/c/prepare.c +++ b/examples/c/prepare.c @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) printf("expect two rows, but %d rows are fetched\n", rows); } - taos_free_result(result); +// taos_free_result(result); taos_stmt_close(stmt); return 0; diff --git a/utils/test/c/varbinary_test.c b/utils/test/c/varbinary_test.c index bd0f594b28..e29b94ad1f 100644 --- a/utils/test/c/varbinary_test.c +++ b/utils/test/c/varbinary_test.c @@ -404,7 +404,7 @@ void varbinary_stmt_test(){ v.ts = 1591060628000; for (int i = 0; i < 10; ++i) { v.ts += 1; - for (int j = 1; j < 11; ++j) { + for (int j = 1; j < 3; ++j) { params[j].is_null = ((i == j) ? &is_null : 0); } v.b = (int8_t)i % 2; @@ -450,7 +450,7 @@ void varbinary_stmt_test(){ } ASSERT (rows == 1); - taos_free_result(result); +// taos_free_result(result); taos_stmt_close(stmt); // query the records @@ -483,11 +483,9 @@ void varbinary_stmt_test(){ ASSERT(strcmp(temp, "\\x090A0B0C0D") == 0); } ASSERT (rows == 1); - - taos_free_result(result); - +// taos_free_result(result); taos_stmt_close(stmt); - + taos_close(taos); printf("%s result success\n", __FUNCTION__); } @@ -660,6 +658,7 @@ void varbinary_tmq_test(){ ASSERT(0); } taos_free_result(pRes); + taos_close(pConn); printf("%s result success\n", __FUNCTION__); }