From 246bc397bb4c0d653f3aac91b7104db4f0d28dd6 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 25 Aug 2021 17:48:26 +0800 Subject: [PATCH] [TD-6167] process stmt is null in stmt_close --- src/client/src/tscPrepare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 1ccdef1ced..12ae0ef8f5 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -1781,8 +1781,8 @@ int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name) { int taos_stmt_close(TAOS_STMT* stmt) { STscStmt* pStmt = (STscStmt*)stmt; - if (pStmt == NULL){ - STMT_RET(TSDB_CODE_SUCCESS); + if (stmt == NULL || pStmt->pSql == NULL || pStmt->taos == NULL) { + STMT_RET(TSDB_CODE_TSC_DISCONNECTED); } if (!pStmt->isInsert) { SNormalStmt* normal = &pStmt->normal; -- GitLab