qemu-config: never call the callback after an error, fix leak
commite72f9524febb78ee5ae2a201245cd7b1fb97ad08
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 5 Jul 2021 17:14:37 +0000 (5 19:14 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 20 Jul 2021 15:06:28 +0000 (20 17:06 +0200)
tree9a7d567e76bcd730cf1636f5f67d32f2a370442c
parent143c2e0432859826c9e8d5b2baa307355f1a5332
qemu-config: never call the callback after an error, fix leak

Ensure that the callback to qemu_config_foreach is never called upon
an error, by moving the invocation before the "out" label.

Cc: armbru@redhat.com
Fixes: 3770141139 ("qemu-config: parse configuration files to a QDict", 2021-06-04)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
util/qemu-config.c