>From 328538b4db33f3808da8a9f5edceb48406d6acdc Mon Sep 17 00:00:00 2001
From: Libo Chen <clbchenlibo.c...@huawei.com>
Date: Fri, 30 Aug 2013 17:46:39 +0800
Subject: [PATCH 5/5] 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 <dhaval.gi...@gmail.com>

Signed-off-by: Libo Chen <clbchenlibo.c...@huawei.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 76aee94..38a9f15 100644
--- a/src/tools/cgconfig.c
+++ b/src/tools/cgconfig.c
@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
        if (error) {
                fprintf(stderr, "%s: cannot set default UID and GID: %s\n",
                                argv[0], cgroup_strerror(ret));
-               goto err;
+               goto free_cgroup;
        }

        if (dirm_change | filem_change) {
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
        if (error) {
                fprintf(stderr, "%s: cannot set config parser defaults: %s\n",
                                argv[0], cgroup_strerror(ret));
-               goto err;
+               goto free_cgroup;
        }

        for (i = 0; i < cfg_files.count; i++) {
@@ -184,8 +184,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=58040911&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