From 22c8ac96f6cdddca1e3788c888c7d837fedf9c44 Mon Sep 17 00:00:00 2001 From: t00416110 Date: Thu, 20 Jun 2019 16:26:59 -0400 Subject: [PATCH] parse.c: fix fd leak from memfd_create Signed-off-by: t00416110 --- src/lxc/parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. */ -- 2.47.2