fix mem leak
This commit is contained in:
parent
8684ea997a
commit
dcf06061cd
|
@ -36,12 +36,12 @@ static int32_t dmProcessStatusRsp(SDnode *pDnode, SRpcMsg *pRsp) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SStatusRsp statusRsp = {0};
|
SStatusRsp statusRsp = {0};
|
||||||
if (pRsp->pCont != NULL && pRsp->contLen > 0 &&
|
if (pRsp->pCont != NULL && pRsp->contLen > 0 && tDeserializeSStatusRsp(pRsp->pCont, pRsp->contLen, &statusRsp) == 0) {
|
||||||
tDeserializeSStatusRsp(pRsp->pCont, pRsp->contLen, &statusRsp) == 0) {
|
|
||||||
pDnode->data.dnodeVer = statusRsp.dnodeVer;
|
pDnode->data.dnodeVer = statusRsp.dnodeVer;
|
||||||
dmUpdateDnodeCfg(pDnode, &statusRsp.dnodeCfg);
|
dmUpdateDnodeCfg(pDnode, &statusRsp.dnodeCfg);
|
||||||
dmUpdateEps(pDnode, statusRsp.pDnodeEps);
|
dmUpdateEps(pDnode, statusRsp.pDnodeEps);
|
||||||
}
|
}
|
||||||
|
rpcFreeCont(pRsp->pCont);
|
||||||
tFreeSStatusRsp(&statusRsp);
|
tFreeSStatusRsp(&statusRsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void dmSendStatusReq(SDnode *pDnode) {
|
||||||
req.pVloads = info.pVloads;
|
req.pVloads = info.pVloads;
|
||||||
|
|
||||||
int32_t contLen = tSerializeSStatusReq(NULL, 0, &req);
|
int32_t contLen = tSerializeSStatusReq(NULL, 0, &req);
|
||||||
void *pHead = rpcMallocCont(contLen);
|
void * pHead = rpcMallocCont(contLen);
|
||||||
tSerializeSStatusReq(pHead, contLen, &req);
|
tSerializeSStatusReq(pHead, contLen, &req);
|
||||||
tFreeSStatusReq(&req);
|
tFreeSStatusReq(&req);
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ int32_t dmProcessGrantRsp(SDnode *pDnode, SNodeMsg *pMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t dmProcessConfigReq(SDnode *pDnode, SNodeMsg *pMsg) {
|
int32_t dmProcessConfigReq(SDnode *pDnode, SNodeMsg *pMsg) {
|
||||||
SRpcMsg *pReq = &pMsg->rpcMsg;
|
SRpcMsg * pReq = &pMsg->rpcMsg;
|
||||||
SDCfgDnodeReq *pCfg = pReq->pCont;
|
SDCfgDnodeReq *pCfg = pReq->pCont;
|
||||||
dError("config req is received, but not supported yet");
|
dError("config req is received, but not supported yet");
|
||||||
return TSDB_CODE_OPS_NOT_SUPPORT;
|
return TSDB_CODE_OPS_NOT_SUPPORT;
|
||||||
|
|
|
@ -471,7 +471,8 @@ static void addConnToPool(void* pool, SCliConn* conn) {
|
||||||
assert(!QUEUE_IS_EMPTY(&plist->conn));
|
assert(!QUEUE_IS_EMPTY(&plist->conn));
|
||||||
}
|
}
|
||||||
static void cliAllocRecvBufferCb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
|
static void cliAllocRecvBufferCb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
|
||||||
SCliConn* conn = handle->data;
|
SCliConn* conn = handle->data;
|
||||||
|
tError("oh no %p", conn);
|
||||||
SConnBuffer* pBuf = &conn->readBuf;
|
SConnBuffer* pBuf = &conn->readBuf;
|
||||||
transAllocBuffer(pBuf, buf);
|
transAllocBuffer(pBuf, buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue