From: Kevin Wolf Date: Wed, 16 Mar 2016 10:14:31 +0000 (+0100) Subject: block: Fix memory leak in hmp_drive_add_node() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f8746fb804dad4858796363adb06c56543111062;p=qemu.git block: Fix memory leak in hmp_drive_add_node() hmp_drive_add_node() leaked qdict in the error path when no node-name is specified. Signed-off-by: Kevin Wolf Reviewed-by: Markus Armbruster --- diff --git a/blockdev.c b/blockdev.c index e7b8676495..50410bf328 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3898,6 +3898,7 @@ void hmp_drive_add_node(Monitor *mon, const char *optstr) qdict = qemu_opts_to_qdict(opts, NULL); if (!qdict_get_try_str(qdict, "node-name")) { + QDECREF(qdict); error_report("'node-name' needs to be specified"); goto out; }