qemu: Fix possible memory leak in migration param processing

If virJSONValueArraySize(caps) <= 0, then we will still need to
virJSONValueFree(caps) because qemuMonitorSetMigrationCapabilities
won't consume it.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2018-04-17 11:43:30 -04:00
parent 6df5d77723
commit 6a6a5463af

View File

@ -771,6 +771,7 @@ qemuMigrationParamsApply(virQEMUDriverPtr driver,
migParams->params[xbzrle].set = true;
virJSONValueFree(params);
virJSONValueFree(caps);
return ret;
}