]> git.proxmox.com Git - mirror_qemu.git/commitdiff
blkverify: Fix BDS leak in .bdrv_open error path
authorKevin Wolf <kwolf@redhat.com>
Tue, 13 Oct 2015 12:15:53 +0000 (14:15 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 16 Oct 2015 13:34:30 +0000 (15:34 +0200)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
block/blkverify.c

index f8655add63313ba6e33d4fc56ab5fbe87fea858f..c5f8e8dcba15a45f7ed57d1aa825a839ed49471b 100644 (file)
@@ -143,6 +143,9 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
 
     ret = 0;
 fail:
+    if (ret < 0) {
+        bdrv_unref_child(bs, bs->file);
+    }
     qemu_opts_del(opts);
     return ret;
 }