mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
29cf933635
commit
adb998c12a
|
@ -295,6 +295,7 @@ static BlockBackend *img_open_opts(const char *optstr,
|
||||||
if (qdict_haskey(options, BDRV_OPT_FORCE_SHARE)
|
if (qdict_haskey(options, BDRV_OPT_FORCE_SHARE)
|
||||||
&& !qdict_get_bool(options, BDRV_OPT_FORCE_SHARE)) {
|
&& !qdict_get_bool(options, BDRV_OPT_FORCE_SHARE)) {
|
||||||
error_report("--force-share/-U conflicts with image options");
|
error_report("--force-share/-U conflicts with image options");
|
||||||
|
QDECREF(options);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
|
qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
|
||||||
|
|
Loading…
Reference in New Issue