[PATCH] Fix leak build config file path

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

* src/libvirt.c: Free user directory path
---
 src/libvirt.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index cdd111c..55ef743 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -974,8 +974,11 @@ virConnectConfigFile(void)
             goto error;
 
         if (virAsprintf(&path, "%s/.libvirt/libvirt.conf",
-                        userdir) < 0)
+                        userdir) < 0) {
+            VIR_FREE(userdir);
             goto no_memory;
+        }
+        VIR_FREE(userdir);
     }
 
     return path;
-- 
1.7.6.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]