aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-05-15 22:10:14 +0800
committerMax Reitz <mreitz@redhat.com>2017-05-29 15:39:54 +0200
commitadb998c12aa7aa22c78baaec5c1252721e89c3de (patch)
tree0ec5571dcefb31316f191bfe3618c80c81827b1a /qemu-img.c
parent29cf933635a50a4f1c51b022b323089997471e38 (diff)
qemu-img: Fix leakage of options on error
Reported by Coverity. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 20170515141014.25793-1-famz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 0bf941ba56..5aef8ef047 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));