Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>

diff --git a/src/api.c b/src/api.c
index bfd0177..a91d45c 100644
--- a/src/api.c
+++ b/src/api.c
@@ -2784,7 +2784,6 @@ static int cgroup_create_template_group(char 
*orig_group_name,
        if (group_name == NULL) {
                ret = ECGOTHER;
                last_errno = errno;
-               free(template_name);
                goto end;
        }
 
@@ -2851,10 +2850,8 @@ while_end:
                group_position[0] = '/';
 
 end:
-       if (group_name != NULL)
-               free(group_name);
-       if (template_name != NULL)
-               free(template_name);
+       free(group_name);
+       free(template_name);
        return ret;
 }
 
-- 
2.4.3


------------------------------------------------------------------------------
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to