]> Git Repo - qemu.git/commitdiff
qemu-img: Fix leakage of options on error
authorFam Zheng <[email protected]>
Mon, 15 May 2017 14:10:14 +0000 (22:10 +0800)
committerMax Reitz <[email protected]>
Mon, 29 May 2017 13:39:54 +0000 (15:39 +0200)
Reported by Coverity.

Signed-off-by: Fam Zheng <[email protected]>
Message-id: 20170515141014[email protected]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
qemu-img.c

index 0bf941ba56164d933fbba288b31cebf992328b88..5aef8ef0476ebb07a39225851a9151efad276ac2 100644 (file)
@@ -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));
This page took 0.032018 seconds and 4 git commands to generate.