mirror of https://github.com/xemu-project/xemu.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 <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
23f7fcb295
commit
f8746fb804
|
@ -3898,6 +3898,7 @@ void hmp_drive_add_node(Monitor *mon, const char *optstr)
|
||||||
qdict = qemu_opts_to_qdict(opts, NULL);
|
qdict = qemu_opts_to_qdict(opts, NULL);
|
||||||
|
|
||||||
if (!qdict_get_try_str(qdict, "node-name")) {
|
if (!qdict_get_try_str(qdict, "node-name")) {
|
||||||
|
QDECREF(qdict);
|
||||||
error_report("'node-name' needs to be specified");
|
error_report("'node-name' needs to be specified");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue