From 282ff0c9a610db90993d7f52cd4a19359353663c Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 6 Aug 2020 15:34:27 +0100 Subject: [PATCH] jail: only free cgroups if they were allocated Fixes segfault on shutdown with slim containers. Signed-off-by: Daniel Golle --- jail/jail.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jail/jail.c b/jail/jail.c index d59afa5..42b2d3f 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -260,7 +260,8 @@ static void free_opts(bool parent) { free(*(tmp++)); free(opts.envp); - cgroups_free(); + if (opts.ocibundle) + cgroups_free(); }; free_rlimits(); -- 2.30.2