aboutsummaryrefslogtreecommitdiff
path: root/libexec/ftpd/(public-mirror)
diff options
context:
space:
mode:
authorJitendra Bhati <bhatijitendra2022@gmail.com>2026-08-15 16:06:39 +0000
committerAlan Somers <asomers@FreeBSD.org>2026-08-17 20:06:57 +0000
commit9b8c2bffeba9861c3f5bda0e5a08943e5ed4853f (patch)
tree7041a64bd6e50f2ddebfa0695b0e6ba9c5c69f5b /libexec/ftpd/(public-mirror)
parenta77edeb0e54ad3e96e2a6c685d5c26eac4ba190a (diff)
fts: fix file descriptor leak in fts_closeHEADmain
fts_build() stores a dup'd file descriptor in each directory entry's fts_dirfd. When a traversal is abandoned before completion and fts_close() is called, the cleanup loop freed each pending entry with free() without first closing its fts_dirfd, leaking one descriptor per pending directory. Close fts_dirfd before freeing each entry in the cleanup loop, matching the handling already applied to the dummy parent entry after the loop. Add a regression test that descends a couple of levels, abandons the traversal, closes, and asserts the open descriptor count is unchanged. PR: 297557 Reported by: asomers Fixes: 4bd01d6ae016 Sponsored by: Google LLC (GSoC 2026) Reviewed by: asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/2373
Diffstat (limited to 'libexec/ftpd/(public-mirror)')
0 files changed, 0 insertions, 0 deletions