]> git.proxmox.com Git - mirror_lxc.git/commitdiff
initutils: close dirfd in error path
authorSimon Deziel <simon.deziel@canonical.com>
Tue, 29 Jun 2021 15:50:09 +0000 (11:50 -0400)
committerSimon Deziel <simon.deziel@canonical.com>
Tue, 29 Jun 2021 15:50:09 +0000 (11:50 -0400)
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
src/lxc/initutils.c

index f5e41804dd858d24918e4ddd0e55576c3ce6faac..ce0e0349c918ece02922047a0bdfc75aa3e3212c 100644 (file)
@@ -458,8 +458,10 @@ restart:
                if (fd == STDERR_FILENO || fd == fddir)
                        break;
 
-               if (close(fd))
+               if (close(fd)) {
+                       closedir(dir);
                        return -errno;
+               }
 
                closedir(dir);
                goto restart;