From e9accd26dffcfef19af87d9545b8f701781ee4c1 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 14 Jul 2022 10:40:46 +0800 Subject: [PATCH] fix:double free error for parserTest --- include/common/tmsg.h | 1 + source/libs/parser/src/parInsert.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 5e7e045b78..c8e13fce3d 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1989,6 +1989,7 @@ static FORCE_INLINE void tdDestroySVCreateTbReq(SVCreateTbReq* req) { taosMemoryFreeClear(req->ctb.pTag); taosMemoryFreeClear(req->ctb.name); taosArrayDestroy(req->ctb.tagName); + req->ctb.tagName = NULL; } else if (req->type == TSDB_NORMAL_TABLE) { taosMemoryFreeClear(req->ntb.schemaRow.pSchema); } diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 935cadc484..005a7f919a 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -1514,6 +1514,7 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery, SParseMetaCache .pSql = (char*)pContext->pSql, .msg = {.buf = pContext->pMsg, .len = pContext->msgLen}, .pTableMeta = NULL, + .createTblReq = {0}, .pSubTableHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK), .pTableNameHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK), .pDbFNameHashObj = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK),