[PATCH] virStorageSourceClear: Unref @vhostuser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/conf/storage_source_conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c
index 7706bbd8da..67c3aedefb 100644
--- a/src/conf/storage_source_conf.c
+++ b/src/conf/storage_source_conf.c
@@ -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);
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux