On 12/2/20 6:34 PM, John Ferlan wrote:
Let's pass along / fill @niothreads rather than trying to make
dual
use as a return value and thread count.
This resolves a Coverity issue detected in qemuDomainGetIOThreadsMon
where if qemuDomainObjExitMonitor failed, then a -1 was returned and
overwrite @niothreads causing a memory leak.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Since v1, updated the logic to pass @niothreads around rather than
rely on the dual meaning. Took the full plunge.
src/qemu/qemu_driver.c | 23 +++++++++++------------
src/qemu/qemu_monitor.c | 8 +++++---
src/qemu/qemu_monitor.h | 3 ++-
src/qemu/qemu_monitor_json.c | 6 ++++--
src/qemu/qemu_monitor_json.h | 3 ++-
src/qemu/qemu_process.c | 4 ++--
tests/qemumonitorjsontest.c | 4 ++--
7 files changed, 28 insertions(+), 23 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Michal