Commit 549d71f3 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

aio: don't leak memory

CID 161664 (#1 of 1): Resource leak (RESOURCE_LEAK)
11. leaked_storage: Variable re going out of scope leaks the storage it points to.
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 2a835eb8
......@@ -31,8 +31,10 @@ int dump_aio_ring(MmEntry *mme, struct vma_area *vma)
re->id = vma->e->start;
re->ring_len = vma->e->end - vma->e->start;
re->nr_req = aio_estimate_nr_reqs(re->ring_len);
if (!re->nr_req)
if (!re->nr_req) {
xfree(re);
return -1;
}
mme->aios[nr] = re;
mme->n_aios = nr + 1;
pr_info("Dumping AIO ring @%"PRIx64"-%"PRIx64"\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment