When group->index == 0, uninitialized variable path might get freed. Path is always freed in the loop, so it is useless to free it before return.
Signed-off-by: Jan Safranek <jsafr...@redhat.com> --- src/api.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/src/api.c b/src/api.c index 207d076..d68a4c8 100644 --- a/src/api.c +++ b/src/api.c @@ -1350,7 +1350,7 @@ int cgroup_modify_cgroup(struct cgroup *cgroup) { char *path, base[FILENAME_MAX]; int i; - int error; + int error = 0; int ret; if (!cgroup_initialized) @@ -1388,12 +1388,7 @@ int cgroup_modify_cgroup(struct cgroup *cgroup) goto err; } } - if (path) - free(path); - return 0; err: - if (path) - free(path); return error; } ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel