mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 09:39:13 +00:00
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: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
2a835eb8d1
commit
549d71f3cc
1 changed files with 3 additions and 1 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue