summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nspawn/nspawn-settings.c2
-rw-r--r--src/nspawn/nspawn.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c
index 7500eabd18..94a4c80ed6 100644
--- a/src/nspawn/nspawn-settings.c
+++ b/src/nspawn/nspawn-settings.c
@@ -114,6 +114,8 @@ static void free_oci_hooks(OciHook *h, size_t n) {
void device_node_array_free(DeviceNode *node, size_t n) {
size_t i;
+ assert(node || n == 0);
+
for (i = 0; i < n; i++)
free(node[i].path);
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 49802d6fdf..5d49e05064 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -4651,6 +4651,7 @@ static int merge_settings(Settings *settings, const char *path) {
device_node_array_free(arg_extra_nodes, arg_n_extra_nodes);
arg_extra_nodes = TAKE_PTR(settings->extra_nodes);
arg_n_extra_nodes = settings->n_extra_nodes;
+ settings->n_extra_nodes = 0;
return 0;
}