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 <jferlan@redhat.com>
Reviewed-by: Katerina Koukiou <kkoukiou@redhat.com>
This commit is contained in:
John Ferlan committed 2018-06-11 18:33:13 -04:00
1 parent 462abad2e7
commit 30b2ebb284
1 file changed
+1 -1
+1 -1
View 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);