]> xenbits.xensource.com Git - libvirt.git/commitdiff
virStorageSourceClear: Unref @vhostuser
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 9 Feb 2021 19:16:03 +0000 (20:16 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Feb 2021 10:54:38 +0000 (11:54 +0100)
The @vhostuser member of virStorageSource structure is allocated
during parsing in virDomainDiskSourceVHostUserParse() but never
freed leading to a memleak. Since the member is an object it has
to be unrefed instead of g_free()-d.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/conf/storage_source_conf.c

index 7706bbd8da3421015dcd2b1fb21c6530ed2b80dc..67c3aedefb7c37bce8c76ed3f4850248fc25a655 100644 (file)
@@ -1125,6 +1125,7 @@ virStorageSourceClear(virStorageSourcePtr def)
     virStorageEncryptionFree(def->encryption);
     virStoragePRDefFree(def->pr);
     virStorageSourceNVMeDefFree(def->nvme);
+    virObjectUnref(def->vhostuser);
     virStorageSourceSeclabelsClear(def);
     virStoragePermsFree(def->perms);
     VIR_FREE(def->timestamps);