]> git.proxmox.com Git - mirror_lxc.git/commitdiff
seccomp: leak fixup
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 25 May 2018 06:42:01 +0000 (08:42 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 25 May 2018 06:58:30 +0000 (08:58 +0200)
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: ccf8d128e430 ("seccomp: parse_config_v1()")
src/lxc/seccomp.c

index 101b5fee4012463b2d2cd06656aad9cb230418b5..057e57082cef6664a36fc28fc96fbdae65bf88b7 100644 (file)
@@ -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);