Merge pull request #2463 from taosdata/hotfix/leak
memory leak if vnode not exist
This commit is contained in:
commit
38ce13015c
|
@ -131,6 +131,7 @@ void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) {
|
||||||
.msgType = 0
|
.msgType = 0
|
||||||
};
|
};
|
||||||
rpcSendResponse(&rpcRsp);
|
rpcSendResponse(&rpcRsp);
|
||||||
|
rpcFreeCont(pMsg->pCont);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) {
|
||||||
.msgType = 0
|
.msgType = 0
|
||||||
};
|
};
|
||||||
rpcSendResponse(&rpcRsp);
|
rpcSendResponse(&rpcRsp);
|
||||||
|
rpcFreeCont(pMsg->pCont);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -331,6 +331,7 @@ void rpcFreeCont(void *cont) {
|
||||||
if ( cont ) {
|
if ( cont ) {
|
||||||
char *temp = ((char *)cont) - sizeof(SRpcHead) - sizeof(SRpcReqContext);
|
char *temp = ((char *)cont) - sizeof(SRpcHead) - sizeof(SRpcReqContext);
|
||||||
free(temp);
|
free(temp);
|
||||||
|
// tTrace("free mem: %p", temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -540,6 +541,7 @@ static void rpcFreeMsg(void *msg) {
|
||||||
if ( msg ) {
|
if ( msg ) {
|
||||||
char *temp = (char *)msg - sizeof(SRpcReqContext);
|
char *temp = (char *)msg - sizeof(SRpcReqContext);
|
||||||
free(temp);
|
free(temp);
|
||||||
|
// tTrace("free mem: %p", temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -418,6 +418,8 @@ static int taosReadTcpData(SFdObj *pFdObj, SRecvInfo *pInfo) {
|
||||||
if ( NULL == buffer) {
|
if ( NULL == buffer) {
|
||||||
tError("%s %p TCP malloc(size:%d) fail", pThreadObj->label, pFdObj->thandle, msgLen);
|
tError("%s %p TCP malloc(size:%d) fail", pThreadObj->label, pFdObj->thandle, msgLen);
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
// tTrace("malloc mem: %p", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = buffer + tsRpcOverhead;
|
msg = buffer + tsRpcOverhead;
|
||||||
|
|
|
@ -211,6 +211,8 @@ static void *taosRecvUdpData(void *param) {
|
||||||
if (NULL == tmsg) {
|
if (NULL == tmsg) {
|
||||||
tError("%s failed to allocate memory, size:%ld", pConn->label, dataLen);
|
tError("%s failed to allocate memory, size:%ld", pConn->label, dataLen);
|
||||||
continue;
|
continue;
|
||||||
|
} else {
|
||||||
|
// tTrace("malloc mem: %p", tmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmsg += tsRpcOverhead; // overhead for SRpcReqContext
|
tmsg += tsRpcOverhead; // overhead for SRpcReqContext
|
||||||
|
|
Loading…
Reference in New Issue