conf: reinitialize sysctl list after clearing it

parent 0b382e93
...@@ -3773,7 +3773,7 @@ int lxc_clear_sysctls(struct lxc_conf *c, const char *key) ...@@ -3773,7 +3773,7 @@ int lxc_clear_sysctls(struct lxc_conf *c, const char *key)
else else
return -1; return -1;
lxc_list_for_each_safe (it, &c->sysctls, next) { lxc_list_for_each_safe(it, &c->sysctls, next) {
struct lxc_sysctl *elem = it->elem; struct lxc_sysctl *elem = it->elem;
if (!all && !strequal(elem->key, k)) if (!all && !strequal(elem->key, k))
...@@ -3786,6 +3786,9 @@ int lxc_clear_sysctls(struct lxc_conf *c, const char *key) ...@@ -3786,6 +3786,9 @@ int lxc_clear_sysctls(struct lxc_conf *c, const char *key)
free(it); free(it);
} }
if (all)
lxc_list_init(&c->sysctls);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment