From 847c0176e0e6b1f2b4209c4599795b2c528081fb Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Thu, 25 Aug 2022 17:14:51 +0800 Subject: [PATCH] fix(query): fix valgrind report unitialized variable error --- source/client/src/clientImpl.c | 2 +- source/libs/parser/src/parInsert.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 35c09f8357..102ec9c0e0 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -1956,7 +1956,7 @@ _OVER: int32_t appendTbToReq(SHashObj* pHash, int32_t pos1, int32_t len1, int32_t pos2, int32_t len2, const char* str, int32_t acctId, char* db) { - SName name; + SName name = {0}; if (len1 <= 0) { return -1; diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 4e32672697..c9115d90e1 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -1715,7 +1715,7 @@ static int32_t skipUsingClause(SInsertParseSyntaxCxt* pCxt) { } static int32_t collectTableMetaKey(SInsertParseSyntaxCxt* pCxt, bool isStable, int32_t tableNo, SToken* pTbToken) { - SName name; + SName name = {0}; CHECK_CODE(createSName(&name, pTbToken, pCxt->pComCxt->acctId, pCxt->pComCxt->db, &pCxt->msg)); CHECK_CODE(reserveTableMetaInCacheForInsert(&name, isStable ? CATALOG_REQ_TYPE_META : CATALOG_REQ_TYPE_BOTH, tableNo, pCxt->pMetaCache)); @@ -1730,7 +1730,7 @@ static int32_t checkTableName(const char* pTableName, SMsgBuf* pMsgBuf) { } static int32_t collectAutoCreateTableMetaKey(SInsertParseSyntaxCxt* pCxt, int32_t tableNo, SToken* pTbToken) { - SName name; + SName name = {0}; CHECK_CODE(createSName(&name, pTbToken, pCxt->pComCxt->acctId, pCxt->pComCxt->db, &pCxt->msg)); CHECK_CODE(checkTableName(name.tname, &pCxt->msg)); CHECK_CODE(reserveTableMetaInCacheForInsert(&name, CATALOG_REQ_TYPE_VGROUP, tableNo, pCxt->pMetaCache));