From 7e39d3a2dd34a84900e10b4ea1567f3b352659af Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 13 Oct 2015 14:15:53 +0200 Subject: [PATCH] blkverify: Fix BDS leak in .bdrv_open error path Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody --- block/blkverify.c | 3 +++ 1 file changed, 3 insertions(+) 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; }