From 97a9b25848e9f2f15e6c01f4757cb33965856908 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 25 May 2018 08:42:01 +0200 Subject: [PATCH] seccomp: leak fixup Fix an error case not free()ing the line forgotten during the move from fgets() on a static buffer to using getline. Signed-off-by: Wolfgang Bumiller Fixes: ccf8d128e430 ("seccomp: parse_config_v1()") --- src/lxc/seccomp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c index 101b5fee4..057e57082 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -54,8 +54,10 @@ static int parse_config_v1(FILE *f, struct lxc_conf *conf) int nr; ret = sscanf(line, "%d", &nr); - if (ret != 1) - return -1; + if (ret != 1) { + ret = -1; + break; + } #if HAVE_SCMP_FILTER_CTX ret = seccomp_rule_add(conf->seccomp_ctx, SCMP_ACT_ALLOW, nr, 0); -- 2.47.2