blkverify: Fix BDS leak in .bdrv_open error path

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
This commit is contained in:
Kevin Wolf 2015-10-13 14:15:53 +02:00
parent 779020cbdc
commit 7e39d3a2dd
1 changed files with 3 additions and 0 deletions

View 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;
}