From: Libo Chen Date: Tue, 10 Sep 2013 06:27:05 +0000 (+0200) Subject: cgconfig: correct freeing default_cgroup X-Git-Tag: v0.41~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcb15db1084d935929e803bdc40393f01a5f9031;p=thirdparty%2Flibcgroup.git cgconfig: correct freeing default_cgroup We are freeing up default_cgroup even it has not be allocated, there is no need to do that. Yes, it is just a cleanup suggested by Dhaval Giani Signed-off-by: Libo Chen Acked-by: Ivana Hutarova Varekova --- diff --git a/src/tools/cgconfig.c b/src/tools/cgconfig.c index 495e8b65..afbad647 100644 --- a/src/tools/cgconfig.c +++ b/src/tools/cgconfig.c @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) if (error) { fprintf(stderr, "%s: cannot set default UID and GID: %s\n", argv[0], cgroup_strerror(error)); - goto err; + goto free_cgroup; } if (dirm_change | filem_change) { @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) if (error) { fprintf(stderr, "%s: cannot set config parser defaults: %s\n", argv[0], cgroup_strerror(error)); - goto err; + goto free_cgroup; } for (i = 0; i < cfg_files.count; i++) { @@ -186,8 +186,9 @@ int main(int argc, char *argv[]) } } -err: +free_cgroup: cgroup_free(&default_group); +err: cgroup_string_list_free(&cfg_files); return error; }