aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-10-27 11:12:52 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-11-03 11:41:49 +0000
commitb2f27e4438bb9eb302a0976e5b988bdfd55e65dc (patch)
treeb0b12bf9c968739ca5f03c6e057e23299eb3977a /qemu-img.c
parent76a3a34dcefbaac3103148e9c3437749b0732cfe (diff)
qemu-img: Fix insignificant memleak
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 <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: BenoƮt Canet <benoit.canet@nodalink.com> Message-id: 1414404776-4919-4-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c4
1 files changed, 3 insertions, 1 deletions
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;