Skip to content

Commit

Permalink
seccomp: leak fixup
Browse files Browse the repository at this point in the history
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 <w.bumiller@proxmox.com>
Fixes: ccf8d12 ("seccomp: parse_config_v1()")
  • Loading branch information
Blub authored and Christian Brauner committed May 25, 2018
1 parent 6e816a9 commit 0d83285
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lxc/seccomp.c
Expand Up @@ -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);
Expand Down

0 comments on commit 0d83285

Please sign in to comment.