diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 12ae0ef8f5f1d55020d7d7986d7b3cccc1919e94..1ecfc3993d5bff459ead825215eeda860bea5620 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -1503,14 +1503,6 @@ TAOS_STMT* taos_stmt_init(TAOS* taos) { return NULL; } - if (TSDB_CODE_SUCCESS != tscAllocPayload(&pSql->cmd, TSDB_DEFAULT_PAYLOAD_SIZE)) { - free(pSql); - free(pStmt); - terrno = TSDB_CODE_TSC_OUT_OF_MEMORY; - tscError("failed to malloc payload buffer"); - return NULL; - } - tsem_init(&pSql->rspSem, 0, 0); pSql->signature = pSql; pSql->pTscObj = pObj; @@ -1812,7 +1804,7 @@ int taos_stmt_close(TAOS_STMT* stmt) { } } - taos_free_result(pStmt->pSql); + tscFreeRegisteredSqlObj(pStmt->pSql)); tfree(pStmt); STMT_RET(TSDB_CODE_SUCCESS); } diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 026c65a595baedfecb102a6d6428fa0e3f9c4e2d..b55a6947fb3b8c165e63849a524695993b78898c 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -586,7 +586,7 @@ static bool tscKillQueryInDnode(SSqlObj* pSql) { tscBuildAndSendRequest(pSql, NULL); return false; } - + tscFreeRegisteredSqlObj return true; }