fix invalid free

This commit is contained in:
Shengliang Guan 2022-01-06 03:40:20 -08:00
parent e6a0834315
commit f34013a06e
1 changed files with 3 additions and 1 deletions

View File

@ -101,7 +101,9 @@ int32_t dndWriteMsgToWorker(SDnodeWorker *pWorker, void *pCont, int32_t contLen)
}
if (taosWriteQitem(pWorker->queue, pMsg) != 0) {
taosFreeQitem(pMsg);
if (contLen != 0) {
taosFreeQitem(pMsg);
}
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
}