From: John Ferlan Date: Wed, 18 Apr 2018 10:33:42 +0000 (-0400) Subject: test: Fix resource leak in qemumonitorjsontest X-Git-Tag: v4.5.0-rc1~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30b2ebb2844b0fb27a364f166cae35046f486856;p=thirdparty%2Flibvirt.git test: Fix resource leak in qemumonitorjsontest Introduced by commmit id 37bd4571c. Need to goto cleanup and not return directly. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Katerina Koukiou --- diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 3b494a1dba..2eefd06b6e 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2693,7 +2693,7 @@ testQemuMonitorCPUInfo(const void *opaque) vm = qemuMonitorTestGetDomainObj(test); if (!vm) - return -1; + goto cleanup; rc = qemuMonitorGetCPUInfo(qemuMonitorTestGetMonitor(test), &vcpus, data->maxvcpus, true, data->fast);