diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index aea689c0defc02be4fcc67b5903c3b58edd8811a..a001126b21b8eda8265b2148477869044a05bac9 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -5988,7 +5988,11 @@ int32_t tDecodeSMqDataRsp(SDecoder *pDecoder, SMqDataRsp *pRsp) { if (pRsp->withSchema) { SSchemaWrapper *pSW = (SSchemaWrapper *)taosMemoryCalloc(1, sizeof(SSchemaWrapper)); if (pSW == NULL) return -1; - if (tDecodeSSchemaWrapper(pDecoder, pSW) < 0) return -1; + if (tDecodeSSchemaWrapper(pDecoder, pSW) < 0) { + taosMemoryFree(pSW); + return -1; + } + taosArrayPush(pRsp->blockSchema, &pSW); } @@ -6069,7 +6073,10 @@ int32_t tDecodeSTaosxRsp(SDecoder *pDecoder, STaosxRsp *pRsp) { if (pRsp->withSchema) { SSchemaWrapper *pSW = (SSchemaWrapper *)taosMemoryCalloc(1, sizeof(SSchemaWrapper)); if (pSW == NULL) return -1; - if (tDecodeSSchemaWrapper(pDecoder, pSW) < 0) return -1; + if (tDecodeSSchemaWrapper(pDecoder, pSW) < 0) { + taosMemoryFree(pSW); + return -1; + } taosArrayPush(pRsp->blockSchema, &pSW); } diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 8bf1522d6c15c1b92a11bc47f98bdaaf968e2a8f..42a597a305ba5c9f620e87b62e1b3136d070f955 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -433,16 +433,9 @@ static int32_t tqInitDataRsp(SMqDataRsp* pRsp, const SMqPollReq* pReq, int8_t su } #endif - if (subType == TOPIC_SUB_TYPE__COLUMN) { - pRsp->withSchema = false; - } else { - pRsp->withSchema = true; - pRsp->blockSchema = taosArrayInit(0, sizeof(void*)); - if (pRsp->blockSchema == NULL) { - // TODO free - return -1; - } - } + ASSERT(subType == TOPIC_SUB_TYPE__COLUMN); + pRsp->withSchema = false; + return 0; } diff --git a/source/libs/wal/src/walRef.c b/source/libs/wal/src/walRef.c index 5a14bcf962fccecc6b6b8198a9b7ca27a6f48e9a..f9994fd3158cd38f377ecb3f7e293badc52c2531 100644 --- a/source/libs/wal/src/walRef.c +++ b/source/libs/wal/src/walRef.c @@ -32,6 +32,7 @@ SWalRef *walOpenRef(SWal *pWal) { return pRef; } +#if 0 void walCloseRef(SWal *pWal, int64_t refId) { SWalRef **ppRef = taosHashGet(pWal->pRefHash, &refId, sizeof(int64_t)); if (ppRef == NULL) return; @@ -39,6 +40,7 @@ void walCloseRef(SWal *pWal, int64_t refId) { taosHashRemove(pWal->pRefHash, &refId, sizeof(int64_t)); taosMemoryFree(pRef); } +#endif int32_t walRefVer(SWalRef *pRef, int64_t ver) { SWal *pWal = pRef->pWal; @@ -65,10 +67,12 @@ int32_t walRefVer(SWalRef *pRef, int64_t ver) { return 0; } +#if 0 void walUnrefVer(SWalRef *pRef) { pRef->refId = -1; pRef->refFile = -1; } +#endif SWalRef *walRefCommittedVer(SWal *pWal) { SWalRef *pRef = walOpenRef(pWal); diff --git a/source/libs/wal/src/walSeek.c b/source/libs/wal/src/walSeek.c index 4b75db52b710fd5a084ba1c13f5270006d385967..2cb6614b01bab90cc41e0d11408f3380de4a95fc 100644 --- a/source/libs/wal/src/walSeek.c +++ b/source/libs/wal/src/walSeek.c @@ -19,6 +19,7 @@ #include "tref.h" #include "walInt.h" +#if 0 static int64_t walSeekWritePos(SWal* pWal, int64_t ver) { int64_t code = 0; @@ -47,6 +48,7 @@ static int64_t walSeekWritePos(SWal* pWal, int64_t ver) { } return 0; } +#endif int walInitWriteFile(SWal* pWal) { TdFilePtr pIdxTFile, pLogTFile; @@ -134,6 +136,7 @@ int64_t walChangeWrite(SWal* pWal, int64_t ver) { return fileFirstVer; } +#if 0 int walSeekWriteVer(SWal* pWal, int64_t ver) { int64_t code; if (ver == pWal->vers.lastVer) { @@ -158,3 +161,4 @@ int walSeekWriteVer(SWal* pWal, int64_t ver) { return 0; } +#endif