]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
virCgroupNewPartition: Don't leak @newpath
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Jul 2013 07:42:11 +0000 (09:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Jul 2013 07:42:11 +0000 (09:42 +0200)
The @newpath variable is allocated in virCgroupSetPartitionSuffix(). But
it's newer freed.

src/util/vircgroup.c

index ae718592863da3d59542038ea3fa5505ce55378c..e0b25ede0b66e564e3775367c9decac69801f049 100644 (file)
@@ -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