fix memory leak while drop stable

This commit is contained in:
Shengliang Guan 2020-05-14 16:56:24 +08:00
parent cff7b8aff0
commit f2567eb782
2 changed files with 2 additions and 1 deletions

View File

@ -546,6 +546,7 @@ static void *mgmtGetSuperTableByUid(uint64_t uid) {
pIter = mgmtGetNextSuperTable(pIter, &pStable); pIter = mgmtGetNextSuperTable(pIter, &pStable);
if (pStable == NULL) break; if (pStable == NULL) break;
if (pStable->uid == uid) { if (pStable->uid == uid) {
sdbFreeIter(pIter);
return pStable; return pStable;
} }
mgmtDecTableRef(pStable); mgmtDecTableRef(pStable);

View File

@ -681,7 +681,7 @@ static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) {
mTrace("vgId:%d, send drop all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle); mTrace("vgId:%d, send drop all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle);
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
SRpcIpSet ipSet = mgmtGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp); SRpcIpSet ipSet = mgmtGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp);
mTrace("vgId:%d, send drop vnode msg to dnode:%d, ahandle:%p", vgId, pVgroup->vnodeGid[i].dnodeId, ahandle); mTrace("vgId:%d, send drop vnode msg to dnode:%d, ahandle:%p", pVgroup->vgId, pVgroup->vnodeGid[i].dnodeId, ahandle);
mgmtSendDropVnodeMsg(pVgroup->vgId, &ipSet, ahandle); mgmtSendDropVnodeMsg(pVgroup->vgId, &ipSet, ahandle);
} }
} }