]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/vvfat: Plug memory leak in enable_write_target()
authorMarkus Armbruster <armbru@redhat.com>
Wed, 28 May 2014 09:16:55 +0000 (11:16 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 30 May 2014 12:26:54 +0000 (14:26 +0200)
I figure the leak originated in bdrv_create2(), and was duplicated
into callers when commit 91a073a dropped that function.  Looks like
the other places have since been fixed.

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>
block/vvfat.c

index 8f5114bd1690788e291a4203407e79ac505006d4..811b39c1ca0708f60d77f1d7aae46aeb0d24c3f4 100644 (file)
@@ -2929,6 +2929,7 @@ static int enable_write_target(BDRVVVFATState *s, Error **errp)
     set_option_parameter(options, BLOCK_OPT_BACKING_FILE, "fat:");
 
     ret = bdrv_create(bdrv_qcow, s->qcow_filename, options, errp);
+    free_option_parameters(options);
     if (ret < 0) {
         goto err;
     }