Browse Source

jail: always call cgroups_free()

In commit 3019f50 ("jail: leak less memory") memory handling in cgroups
related code was refactored. That allows to call cgroups_free()
unconditionally and remove the child-branch of in free_opts().

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle 3 years ago
parent
commit
f67a66f196
1 changed files with 1 additions and 3 deletions
  1. 1 3
      jail/jail.c

+ 1 - 3
jail/jail.c

@@ -249,6 +249,7 @@ static void free_opts(bool parent) {
 
 	free_library_search();
 	mount_free();
+	cgroups_free();
 
 	/* we need to keep argv, envp and seccomp filter in child */
 	if (parent) { /* parent-only */
@@ -259,9 +260,6 @@ static void free_opts(bool parent) {
 
 		free_oci_envp(opts.jail_argv);
 		free_oci_envp(opts.envp);
-	} else { /* child-only */
-		if (opts.ocibundle)
-			cgroups_free();
 	}
 
 	free_rlimits();