]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Merge pull request #3052 from tanyifeng/fd_leak
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 20 Jun 2019 09:33:41 +0000 (11:33 +0200)
committerGitHub <noreply@github.com>
Thu, 20 Jun 2019 09:33:41 +0000 (11:33 +0200)
parse.c: fix fd leak from memfd_create

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. */