aboutsummaryrefslogtreecommitdiff
path: root/block/blkverify.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2015-10-13 14:15:53 +0200
committerKevin Wolf <kwolf@redhat.com>2015-10-16 15:34:30 +0200
commit7e39d3a2dd34a84900e10b4ea1567f3b352659af (patch)
tree9755173a6973f3e54a47fd93685a9d5700f866db /block/blkverify.c
parent779020cbdc67011026c10fb620f701bfc6b85547 (diff)
blkverify: Fix BDS leak in .bdrv_open error path
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'block/blkverify.c')
-rw-r--r--block/blkverify.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blkverify.c b/block/blkverify.c
index f8655add63..c5f8e8dcba 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -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;
}