提交 16a22278 编写于 作者: V Vladimir Sementsov-Ogievskiy 提交者: Eric Blake

migration/block-dirty-bitmap: fix memory leak in dirty_bitmap_load_bits

Release buf on error path too.

Bug was introduced in b35ebdf0 "migration: add postcopy
migration of dirty bitmaps" with the whole function.
Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180427142002.21930-3-vsementsov@virtuozzo.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
CC: qemu-stable@nongnu.org
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 89aa0d87
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册