]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix possible memory leak in migration param processing
authorJohn Ferlan <jferlan@redhat.com>
Tue, 17 Apr 2018 15:43:30 +0000 (11:43 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 19 Apr 2018 18:25:11 +0000 (14:25 -0400)
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>
src/qemu/qemu_migration_params.c

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