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 <kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Kevin Wolf 2016-03-16 11:14:31 +01:00
parent 23f7fcb295
commit f8746fb804

View File

@ -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;
}