From: Fam Zheng Date: Mon, 15 May 2017 14:10:14 +0000 (+0800) Subject: qemu-img: Fix leakage of options on error X-Git-Tag: v2.10.0-rc0~167^2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adb998c12aa7aa22c78baaec5c1252721e89c3de;p=thirdparty%2Fqemu.git qemu-img: Fix leakage of options on error Reported by Coverity. Signed-off-by: Fam Zheng Message-id: 20170515141014.25793-1-famz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- diff --git a/qemu-img.c b/qemu-img.c index 0bf941ba561..5aef8ef0476 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -295,6 +295,7 @@ static BlockBackend *img_open_opts(const char *optstr, if (qdict_haskey(options, BDRV_OPT_FORCE_SHARE) && !qdict_get_bool(options, BDRV_OPT_FORCE_SHARE)) { error_report("--force-share/-U conflicts with image options"); + QDECREF(options); return NULL; } qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));