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 2018-04-18 06:33:42 -04:00
parent 462abad2e7
commit 30b2ebb284

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);