qemu-img: Fix leakage of options on error
PATCH 1/1 qemu-img: Fix leakage of options on error
Reported by Coverity.
Signed-off-by Fam Zheng <[email protected]>
--- qemu-img.c | 1 + 1 file changed, 1 insertion(+)
qemu-img.c +1 -0
@@ -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
Quoted 6 lines · Fam Zheng
Reported by Coverity.
Signed-off-by Fam Zheng <[email protected]>--- qemu-img.c | 1 + 1 file changed, 1 insertion(+)
Reviewed-by Eric Blake <[email protected]>
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Max Reitz
AppliedQuoted 6 lines · Fam Zheng
Reported by Coverity.
Signed-off-by Fam Zheng <[email protected]>--- qemu-img.c | 1 + 1 file changed, 1 insertion(+)
Thanks, applied to my block branch:
https://github.com/XanClic/qemu/commits/block
Max