Skip to contentSkip to conversation

qemu-img: Fix leakage of options on error

PATCH Applied Fam Zheng 3 participants 3 messages May 15, 2017

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 qemu-img: Fix leakage of options on error

Reported by Coverity.

---
 qemu-img.c | 1 +
 1 file changed, 1 insertion(+)
qemu-img.c +1 -0
index b506839..8b0dfa7 100644
@@ -294,6 +294,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));
Signature · 1 line
2.9.3