]> xenbits.xensource.com Git - libvirt.git/commitdiff
test: Fix resource leak in qemumonitorjsontest
authorJohn Ferlan <jferlan@redhat.com>
Wed, 18 Apr 2018 10:33:42 +0000 (06:33 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 11 Jun 2018 22:33:13 +0000 (18:33 -0400)
Introduced by commmit id 37bd4571c. Need to goto cleanup and
not return directly.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Katerina Koukiou <kkoukiou@redhat.com>
tests/qemumonitorjsontest.c

index 3b494a1dba803d0d2b79a12331bbd580ba07fbe6..2eefd06b6e80e74db3036598c6adffbbe6e9caa8 100644 (file)
@@ -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);