diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 030022b0fd0109b44a6098400c5d351a8e5eeed1..1ccdef1cede119cf99f4ab35d8b138f65cef657e 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -1781,6 +1781,9 @@ 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 (!pStmt->isInsert) { SNormalStmt* normal = &pStmt->normal; if (normal->params != NULL) {