diff -upr libcgroup-0.40.rc1.orig/src/config.c libcgroup-0.40.rc1/src/config.c
--- libcgroup-0.40.rc1.orig/src/config.c 2013-09-12 16:40:32.552179000 +0200
+++ libcgroup-0.40.rc1/src/config.c 2013-09-12 17:12:30.218979633 +0200
@@ -130,7 +130,7 @@ int config_insert_cgroup(char *cg_name,
break;
default:
return 0;
- }
+ }
if (*table_index >= *max - 1) {
struct cgroup *newblk;
@@ -151,7 +151,17 @@ int config_insert_cgroup(char *cg_name,
memset(newblk + oldlen, 0, (*max - oldlen) *
sizeof(struct cgroup));
init_cgroup_table(newblk + oldlen, *max - oldlen);
- config_cgroup_table = newblk;
+ config_table = newblk;
+ switch (flag) {
+ case CGROUP:
+ config_cgroup_table = config_table;
+ break;
+ case TEMPLATE:
+ config_template_table = config_table;
+ break;
+ default:
+ return 0;
+ }
cgroup_dbg("maximum %d\n", *max);
cgroup_dbg("reallocated config_table to %p\n",
config_table);