]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
proto: fix file descriptor leak
authorLuca Di Maio <luca.dimaio1@gmail.com>
Fri, 24 Oct 2025 19:36:48 +0000 (21:36 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Fri, 7 Nov 2025 12:17:04 +0000 (13:17 +0100)
fix leak of pathfd introduced in commit 8a4ea72724930cfe262ccda03028264e1a81b145

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Fixes: 8a4ea72724930c ("proto: add ability to populate a filesystem from a directory")
mkfs/proto.c

index 2b29240db95f7497b5fcd93a2b89a90c9218f061..1a7b3586581278ca24395176d559f7fa1e5dd8de 100644 (file)
@@ -1772,6 +1772,7 @@ handle_direntry(
        create_nondir_inode(mp, pip, fsxp, mode, creds, xname, flags, file_stat,
                            rdev, fd, fname);
 out:
+       close(pathfd);
        /* Reset path_buf to original */
        path_buf[path_len] = '\0';
 }