Commit adb998c1 authored by Fam Zheng's avatar Fam Zheng Committed by Max Reitz
Browse files

qemu-img: Fix leakage of options on error



Reported by Coverity.

Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Message-id: 20170515141014.25793-1-famz@redhat.com
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
parent 29cf9336
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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));