From: Michal Privoznik Date: Wed, 3 Jul 2013 07:42:11 +0000 (+0200) Subject: virCgroupNewPartition: Don't leak @newpath X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bc132221853f73a8b4c6c6f13dbfc579ae8dc2a7;p=people%2Fdariof%2Flibvirt.git virCgroupNewPartition: Don't leak @newpath The @newpath variable is allocated in virCgroupSetPartitionSuffix(). But it's newer freed. --- diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index ae7185928..e0b25ede0 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