Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
qemu-img: Fix leak
Browse files Browse the repository at this point in the history
create_opts was leaked here.  This is not too bad since the process is
about to exit anyway, but relying on that does not make the code nicer
to read.

Fixes: d402b6a
Reported-by: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed Nov 21, 2018
1 parent f099887 commit 3ecd5a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions qemu-img.c
Expand Up @@ -263,6 +263,7 @@ static int print_block_option_help(const char *filename, const char *fmt)
if (!proto_drv->create_opts) {
error_report("Protocol driver '%s' does not support image creation",
proto_drv->format_name);
qemu_opts_free(create_opts);
return 1;
}
create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
Expand Down

0 comments on commit 3ecd5a4

Please sign in to comment.