free(uname);
}
+static void free_cgroup_settings(struct lxc_list *result)
+{
+ struct lxc_list *iterator, *next;
+
+ lxc_list_for_each_safe(iterator, result, next) {
+ lxc_list_del(iterator);
+ free(iterator);
+ }
+ free(result);
+}
+
/*
* Return the list of cgroup_settings sorted according to the following rules
* 1. Put memory.limit_in_bytes before memory.memsw.limit_in_bytes
item = malloc(sizeof(*item));
if (!item) {
ERROR("failed to allocate memory to sort cgroup settings");
+ free_cgroup_settings(result);
return NULL;
}
item->elem = it->elem;
}
return result;
-}
\ No newline at end of file
+}