From dc3e3fd7477d264e179621155b3621e0919c92f2 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 26 Aug 2021 11:25:49 +0800 Subject: [PATCH] [TD-6167] add null pointer protection --- src/client/src/tscPrepare.c | 1 - tests/script/api/stmt.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 725d9d9850..099ee77bc5 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -1986,7 +1986,6 @@ TAOS_RES *taos_stmt_use_result(TAOS_STMT* stmt) { return NULL; } TAOS_RES* result = pStmt->pSql; - pStmt->pSql = NULL; return result; } diff --git a/tests/script/api/stmt.c b/tests/script/api/stmt.c index 685401ef28..168d281f70 100644 --- a/tests/script/api/stmt.c +++ b/tests/script/api/stmt.c @@ -468,7 +468,6 @@ void taos_stmt_use_result_query(void *taos, char *col, int type) { assert(taos_stmt_close(stmt) == 0); free(params); free(stmt_sql); - taos_free_result(result); } void taos_stmt_use_result_test() { -- GitLab