fix memory leak
This commit is contained in:
parent
786b368b8a
commit
c19e7779df
|
@ -588,6 +588,8 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) {
|
|||
metaDecodeTbInfo(pBuf, &tbCfg);
|
||||
if (tbCfg.type == META_SUPER_TABLE) {
|
||||
continue;
|
||||
} else if (tbCfg.type == META_CHILD_TABLE) {
|
||||
kvRowFree(tbCfg.ctbCfg.pTag)
|
||||
}
|
||||
return tbCfg.name;
|
||||
} else {
|
||||
|
|
|
@ -71,6 +71,7 @@ int vnodeOpenBufPool(SVnode *pVnode) {
|
|||
|
||||
void vnodeCloseBufPool(SVnode *pVnode) {
|
||||
if (pVnode->pBufPool) {
|
||||
tfree(pVnode->pBufPool->pMAF);
|
||||
vmaDestroy(pVnode->pBufPool->inuse);
|
||||
|
||||
while (true) {
|
||||
|
|
|
@ -119,6 +119,7 @@ static void* loop(void* arg) {
|
|||
pthread_mutex_unlock(&(vnodeMgr.mutex));
|
||||
|
||||
(*(pTask->execute))(pTask->arg);
|
||||
free(pTask);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -145,6 +145,9 @@ static int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
|||
|
||||
_exit:
|
||||
|
||||
free(pSW);
|
||||
free(pTbCfg->name);
|
||||
free(pTbCfg);
|
||||
rpcMsg.handle = pMsg->handle;
|
||||
rpcMsg.ahandle = pMsg->ahandle;
|
||||
rpcMsg.pCont = pTbMetaMsg;
|
||||
|
|
|
@ -34,7 +34,7 @@ int vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs) {
|
|||
pMsg = *(SRpcMsg **)taosArrayGet(pMsgs, i);
|
||||
|
||||
// ser request version
|
||||
void *pBuf = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
|
||||
void * pBuf = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
|
||||
int64_t ver = pVnode->state.processed++;
|
||||
taosEncodeFixedU64(&pBuf, ver);
|
||||
|
||||
|
@ -53,7 +53,7 @@ int vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs) {
|
|||
int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||
SVCreateTbReq vCreateTbReq;
|
||||
SVCreateTbBatchReq vCreateTbBatchReq;
|
||||
void *ptr = vnodeMalloc(pVnode, pMsg->contLen);
|
||||
void * ptr = vnodeMalloc(pVnode, pMsg->contLen);
|
||||
if (ptr == NULL) {
|
||||
// TODO: handle error
|
||||
}
|
||||
|
@ -76,6 +76,9 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
|||
}
|
||||
|
||||
// TODO: maybe need to clear the requst struct
|
||||
free(vCreateTbReq.stbCfg.pSchema);
|
||||
free(vCreateTbReq.stbCfg.pTagSchema);
|
||||
free(vCreateTbReq.name);
|
||||
break;
|
||||
case TDMT_VND_CREATE_TABLE:
|
||||
tSVCreateTbBatchReqDeserialize(POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead)), &vCreateTbBatchReq);
|
||||
|
@ -129,7 +132,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
|||
// TODO: handle error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue