]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
parse.c: fix fd leak from memfd_create 3052/head
authort00416110 <tanyifeng1@huawei.com>
Thu, 20 Jun 2019 20:26:59 +0000 (16:26 -0400)
committert00416110 <tanyifeng1@huawei.com>
Thu, 20 Jun 2019 20:26:59 +0000 (16:26 -0400)
Signed-off-by: t00416110 <tanyifeng1@huawei.com>
src/lxc/parse.c

index 01068ccb34ba6cf50b91e963cc93e226b82a17bb..36bbfdbc7b4c39abe5e6cfbc1b786e2034488239 100644 (file)
@@ -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. */