migration/block-dirty-bitmap: fix memory leak in dirty_bitmap_load_bits
Release buf on error path too.
Bug was introduced in b35ebdf076
"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>
This commit is contained in:
parent
89aa0d8763
commit
16a2227893
@ -600,6 +600,7 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DirtyBitmapLoadState *s)
|
|||||||
ret = qemu_get_buffer(f, buf, buf_size);
|
ret = qemu_get_buffer(f, buf, buf_size);
|
||||||
if (ret != buf_size) {
|
if (ret != buf_size) {
|
||||||
error_report("Failed to read bitmap bits");
|
error_report("Failed to read bitmap bits");
|
||||||
|
g_free(buf);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user