Skip to content
Snippets Groups Projects
Commit bfa3f497 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Fix resource leak.

parent 658645a4
No related branches found
No related tags found
No related merge requests found
......@@ -407,9 +407,15 @@ reshDestroy(cdiResH resH)
nspT = namespaceResHDecode(resH);
xassert(nspT.nsp == nsp && nspT.idx >= 0 && nspT.idx < resHList[nsp].size && resHList[nsp].resources[nspT.idx].res.v.ops);
listElem_t *r = resHList[nsp].resources + nspT.idx;
if (resHList[nsp].resources[nspT.idx].status & RESH_IN_USE_BIT) reshRemove_(nsp, nspT.idx, __func__);
xassert(nspT.nsp == nsp && nspT.idx >= 0 && nspT.idx < resHList[nsp].size && r->res.v.ops);
if (r->status & RESH_IN_USE_BIT)
{
r->res.v.ops->valDestroy(r->res.v.val);
reshRemove_(nsp, nspT.idx, __func__);
}
LIST_UNLOCK();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment