[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 2/4] migration/block-dirty-bitmap: fix memory leak in
From: |
Eric Blake |
Subject: |
[Qemu-block] [PULL 2/4] migration/block-dirty-bitmap: fix memory leak in dirty_bitmap_load_bits |
Date: |
Fri, 4 May 2018 08:30:32 -0500 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Release buf on error path too.
Bug was introduced in b35ebdf076d697bc "migration: add postcopy
migration of dirty bitmaps" with the whole function.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
CC: address@hidden
Signed-off-by: Eric Blake <address@hidden>
---
migration/block-dirty-bitmap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index dd04f102d8d..8819aabe3a0 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -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;
}
--
2.14.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-block] [PULL 2/4] migration/block-dirty-bitmap: fix memory leak in dirty_bitmap_load_bits,
Eric Blake <=