From 488539b97700b336748c2f98616273d0a52eeca7 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 29 Apr 2022 15:15:18 +0800 Subject: [PATCH] fix: uninitialised value while create stb --- source/dnode/mnode/impl/src/mndStb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index f5346db6b2..7cda5f01a2 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -670,8 +670,8 @@ static int32_t mndCreateStb(SMnode *pMnode, SNodeMsg *pReq, SMCreateStbReq *pCre memcpy(stbObj.pAst2, pCreate->pAst2, stbObj.ast2Len); } - stbObj.pColumns = taosMemoryMalloc(stbObj.numOfColumns * sizeof(SSchema)); - stbObj.pTags = taosMemoryMalloc(stbObj.numOfTags * sizeof(SSchema)); + stbObj.pColumns = taosMemoryCalloc(1, stbObj.numOfColumns * sizeof(SSchema)); + stbObj.pTags = taosMemoryCalloc(1, stbObj.numOfTags * sizeof(SSchema)); if (stbObj.pColumns == NULL || stbObj.pTags == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; -- GitLab