From: Wolfgang Bumiller Date: Fri, 25 May 2018 06:42:01 +0000 (+0200) Subject: seccomp: leak fixup X-Git-Tag: lxc-3.1.0~289^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97a9b25848e9f2f15e6c01f4757cb33965856908;p=thirdparty%2Flxc.git 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()") --- 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);