From b2f27e4438bb9eb302a0976e5b988bdfd55e65dc Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 27 Oct 2014 11:12:52 +0100 Subject: qemu-img: Fix insignificant memleak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As soon as options is set in img_amend(), it needs to be freed before the function returns. This leak is rather insignificant, as qemu-img will exit subsequently anyway, but there's no point in not fixing it. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoit Canet Reviewed-by: Kevin Wolf Reviewed-by: BenoƮt Canet Message-id: 1414404776-4919-4-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi --- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qemu-img.c') diff --git a/qemu-img.c b/qemu-img.c index c7b394a7f9..66a7eb4045 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2948,7 +2948,9 @@ static int img_amend(int argc, char **argv) } if (optind != argc - 1) { - error_exit("Expecting one image file name"); + error_report("Expecting one image file name"); + ret = -1; + goto out; } flags = BDRV_O_FLAGS | BDRV_O_RDWR; -- cgit v1.2.3