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 <dhaval.gi...@gmail.com>

Signed-off-by: Libo Chen <clbchenlibo.c...@huawei.com>
Acked-by: Ivana Hutarova Varekova <varek...@redhat.com>
---
 src/tools/cgconfig.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/tools/cgconfig.c b/src/tools/cgconfig.c
index e96ab9d..066a85f 100644
--- a/src/tools/cgconfig.c
+++ b/src/tools/cgconfig.c
@@ -169,7 +169,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) {
@@ -181,7 +181,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++) {
@@ -195,8 +195,9 @@ int main(int argc, char *argv[])
                }
        }
 
-err:
+free_cgroup:
        cgroup_free(&default_group);
+err:
        cgroup_string_list_free(&cfg_files);
        return error;
 }
-- 
1.7.1



------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to