[PATCH 1/2] virCgroupNewPartition: Don't leak @newpath

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

 



The @newpath variable is allocated in virCgroupSetPartitionSuffix(). But
it's newer freed.
---
 src/util/vircgroup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index ae71859..e0b25ed 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1249,7 +1249,7 @@ int virCgroupNewPartition(const char *path,
     int rc;
     char *parentPath = NULL;
     virCgroupPtr parent = NULL;
-    char *newpath;
+    char *newpath = NULL;
     VIR_DEBUG("path=%s create=%d controllers=%x",
               path, create, controllers);
 
@@ -1295,6 +1295,7 @@ cleanup:
         virCgroupFree(group);
     virCgroupFree(&parent);
     VIR_FREE(parentPath);
+    VIR_FREE(newpath);
     return rc;
 }
 #else
-- 
1.8.1.5

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