qemu-img: Plug memory leak on block option help error path
authorMarkus Armbruster <armbru@redhat.com>
Wed, 28 May 2014 09:16:54 +0000 (11:16 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 30 May 2014 12:25:58 +0000 (14:25 +0200)
Introduced in commit a283cb6; mostly harmless.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c

index 1ad899e03bec185fd2db00f4418fe2c6f70eb0ea..62ea27eae5133b0cee819e590f27860d5a5e2d74 100644 (file)
@@ -287,6 +287,7 @@ static int print_block_option_help(const char *filename, const char *fmt)
         proto_drv = bdrv_find_protocol(filename, true);
         if (!proto_drv) {
             error_report("Unknown protocol '%s'", filename);
+            free_option_parameters(create_options);
             return 1;
         }
         create_options = append_option_parameters(create_options,