From: t00416110 Date: Thu, 20 Jun 2019 20:26:59 +0000 (-0400) Subject: parse.c: fix fd leak from memfd_create X-Git-Tag: lxc-3.2.0~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22c8ac96f6cdddca1e3788c888c7d837fedf9c44;p=thirdparty%2Flxc.git parse.c: fix fd leak from memfd_create Signed-off-by: t00416110 --- diff --git a/src/lxc/parse.c b/src/lxc/parse.c index 01068ccb3..36bbfdbc7 100644 --- a/src/lxc/parse.c +++ b/src/lxc/parse.c @@ -98,7 +98,7 @@ int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback, void *da fd = open(file, O_RDONLY | O_CLOEXEC); if (fd < 0) { SYSERROR("Failed to open file \"%s\"", file); - return -1; + goto on_error; } /* sendfile() handles up to 2GB. No config file should be that big. */