mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
76a3a34dce
commit
b2f27e4438
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue