Re: [PATCH] qemu-config: never call the callback after an error, fix leak

2021-07-08 Thread Paolo Bonzini
On 08/07/21 11:24, Markus Armbruster wrote: Looks like the patch fixes two separate issues: 1. Memory leak on ferror() Fixes: f7544edcd32e602af1aae86714dc7c32350d5d7c 2. Callback can run on error. Fixes: 37701411397c7b7d709ae92abd347cc593940ee5 I*think* this happens when the cb()

Re: [PATCH] qemu-config: never call the callback after an error, fix leak

2021-07-08 Thread Markus Armbruster
Paolo Bonzini writes: > Ensure that the callback to qemu_config_foreach is never called upon > an error, by moving the invocation before the "out" label and ensuring > all error cases jump to the label. The qobject_unref however needs > to be done in all cases (which Coverity is already

[PATCH] qemu-config: never call the callback after an error, fix leak

2021-07-07 Thread Paolo Bonzini
Ensure that the callback to qemu_config_foreach is never called upon an error, by moving the invocation before the "out" label and ensuring all error cases jump to the label. The qobject_unref however needs to be done in all cases (which Coverity is already complaining about). The leak is