From a161329b61106ab093aab6d3227ac85e0b8251a9 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Thu, 4 Mar 2010 10:00:36 +0100 Subject: [PATCH] vmdk: fix double free fail_gd error case would also free rgd_buf that was already freed Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- block/vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vmdk.c b/block/vmdk.c index 67a690e..819c1c9 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -315,7 +315,6 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) ret = -errno; goto fail_rgd; } - qemu_free(rgd_buf); /* write GD */ gd_buf = qemu_malloc(gd_size); @@ -336,6 +335,7 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) goto fail_gd; } qemu_free(gd_buf); + qemu_free(rgd_buf); close(p_fd); close(snp_fd); -- 2.7.4