Browse Source

jail: correctly check for null pointer

Handle case where opts.sysctl is not used.

Signed-off-by: Philipp Meier <philipp.meier@westermo.com>
Philipp Meier 1 year ago
parent
commit
24f6bc4322
1 changed files with 4 additions and 0 deletions
  1. 4 0
      jail/jail.c

+ 4 - 0
jail/jail.c

@@ -215,6 +215,10 @@ static void free_hooklist(struct hook_execvpe **hooklist)
 
 static void free_sysctl(void) {
 	struct sysctl_val *cur;
+
+	if (!opts.sysctl)
+		return;
+
 	cur = *opts.sysctl;
 
 	while (cur) {