diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index a146712cab..b1f0ea55d8 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -496,6 +496,11 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) { if (code != 0) { pInst->onlineDnodes = pInst->totalDnodes ? 0 : -1; tscDebug("hb rsp error %s, update server status %d/%d", tstrerror(code), pInst->onlineDnodes, pInst->totalDnodes); + taosThreadMutexUnlock(&clientHbMgr.lock); + taosMemoryFree(pMsg->pData); + taosMemoryFree(pMsg->pEpSet); + tFreeClientHbBatchRsp(&pRsp); + return -1; } if (rspNum) {