Re: [PATCH] vl: fix leak of qdict_crumple return value

2021-07-08 Thread Paolo Bonzini
On 08/07/21 11:05, Markus Armbruster wrote: Minimally invasive fix, but the result is a bit awkward. Possibly neater: if (qobject_type(crumpled) == QTYPE_QLIST) { error_setg(errp, "Lists cannot be at top level of a configuration section"); } e

Re: [PATCH] vl: fix leak of qdict_crumple return value

2021-07-08 Thread Paolo Bonzini
On 08/07/21 11:05, Markus Armbruster wrote: Fixes: c0d4aa82f895af67cbf7772324e05605e22b4162 Good point, will add. Paolo

Re: [PATCH] vl: fix leak of qdict_crumple return value

2021-07-08 Thread Markus Armbruster
Paolo Bonzini writes: > 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 >

[PATCH] vl: fix leak of qdict_crumple return value

2021-07-07 Thread Paolo Bonzini
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