Message ID | 1406311665-2814-4-git-send-email-mreitz@redhat.com |
---|---|
State | New |
Headers | show |
On 07/25/2014 12:07 PM, Max Reitz wrote: > As soon as options is set in img_amend(), it needs to be freed before > the function returns. This leak is rather insignifcant, as qemu-img will > exit subsequently anyway, but there's no point in not fixing it. > > Signed-off-by: Max Reitz <mreitz@redhat.com> > --- > qemu-img.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/qemu-img.c b/qemu-img.c index a06f425..d73a68a 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2809,7 +2809,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;
As soon as options is set in img_amend(), it needs to be freed before the function returns. This leak is rather insignifcant, as qemu-img will exit subsequently anyway, but there's no point in not fixing it. Signed-off-by: Max Reitz <mreitz@redhat.com> --- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)