mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-14 15:02:54 +00:00
migration/block-dirty-bitmap: fix memory leak in dirty_bitmap_load_bits
Release buf on error path too. Bug was introduced inb35ebdf076
"migration: add postcopy migration of dirty bitmaps" with the whole function. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20180427142002.21930-3-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> CC: qemu-stable@nongnu.org Signed-off-by: Eric Blake <eblake@redhat.com> (cherry picked from commit16a2227893
) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
parent
f155487bef
commit
3b52d47418
|
@ -600,6 +600,7 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DirtyBitmapLoadState *s)
|
|||
ret = qemu_get_buffer(f, buf, buf_size);
|
||||
if (ret != buf_size) {
|
||||
error_report("Failed to read bitmap bits");
|
||||
g_free(buf);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue