提交 adb998c1 编写于 作者: F Fam Zheng 提交者: Max Reitz

qemu-img: Fix leakage of options on error

Reported by Coverity.
Signed-off-by: NFam Zheng <famz@redhat.com>
Message-id: 20170515141014.25793-1-famz@redhat.com
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NMax Reitz <mreitz@redhat.com>
上级 29cf9336
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册