From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53425 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZ04m-0006MN-CW for qemu-devel@nongnu.org; Wed, 14 Jul 2010 07:24:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZ04l-0001Px-Cx for qemu-devel@nongnu.org; Wed, 14 Jul 2010 07:24:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14158) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZ04l-0001Nc-6X for qemu-devel@nongnu.org; Wed, 14 Jul 2010 07:24:31 -0400 From: Kevin Wolf Date: Wed, 14 Jul 2010 13:24:00 +0200 Message-Id: <1279106653-24351-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1279106653-24351-1-git-send-email-kwolf@redhat.com> References: <1279106653-24351-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [STABLE][PATCH 01/14] vmdk: fix double free List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aurelien@aurel32.net Cc: kwolf@redhat.com, qemu-devel@nongnu.org fail_gd error case would also free rgd_buf that was already freed Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori (cherry picked from commit a161329b61106ab093aab6d3227ac85e0b8251a9) Conflicts: block/vmdk.c Signed-off-by: Kevin Wolf --- block/vmdk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 4e48622..765e95a 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -285,7 +285,6 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) goto fail_rgd; if (write(snp_fd, rgd_buf, gd_size) == -1) goto fail_rgd; - qemu_free(rgd_buf); /* write GD */ gd_buf = qemu_malloc(gd_size); @@ -298,6 +297,7 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) if (write(snp_fd, gd_buf, gd_size) == -1) goto fail_gd; qemu_free(gd_buf); + qemu_free(rgd_buf); close(p_fd); close(snp_fd); -- 1.7.1.1