vl: fix leak of qdict_crumple return value
commit838e37007cae48d32102e2f2addb2473138a98df
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 5 Jul 2021 17:17:38 +0000 (5 19:17 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 9 Jul 2021 16:21:34 +0000 (9 18:21 +0200)
tree9c60d9bfe8579c8aad5689a06268bff929159ca2
parent533883fd7ec18a99b28815583bce6f78b2c9643b
vl: fix leak of qdict_crumple return value

Coverity reports that qemu_parse_config_group is returning without
unrefing the "crumpled" dictionary in case its top level item is a
list.  But actually the contract with qemu_record_config_group is
the same as for qemu_parse_config_group itself: if those function
need to stash the dictionary they get, they have to take a reference
themselves (currently this is never the case for either function).
Therefore, just add an unconditional qobject_unref(crumpled) to
qemu_parse_config_group.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
softmmu/vl.c