From: Kevin Wolf Date: Tue, 13 Oct 2015 12:15:53 +0000 (+0200) Subject: blkverify: Fix BDS leak in .bdrv_open error path X-Git-Tag: TizenStudio_2.0_p2.3.2~120^2~1^2~132^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e39d3a2dd34a84900e10b4ea1567f3b352659af;p=sdk%2Femulator%2Fqemu.git blkverify: Fix BDS leak in .bdrv_open error path Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody --- diff --git a/block/blkverify.c b/block/blkverify.c index f8655ad..c5f8e8d 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; }