To: vim_dev@googlegroups.com Subject: Patch 8.2.3544 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3544 Problem: Unix: may leak file descriptor when using a non-existing directory. Solution: Always close the file. (closes #9023) Files: src/os_unix.c *** ../vim-8.2.3543/src/os_unix.c 2021-10-13 10:05:26.863362862 +0100 --- src/os_unix.c 2021-10-20 09:55:51.306497212 +0100 *************** *** 2681,2687 **** verbose_leave(); } l = fchdir(fd); - close(fd); } else #endif --- 2681,2686 ---- *************** *** 2689,2694 **** --- 2688,2697 ---- if (l != 0) emsg(_(e_prev_dir)); } + #ifdef HAVE_FCHDIR + if (fd >= 0) + close(fd); + #endif l = STRLEN(buf); if (l >= len - 1) *** ../vim-8.2.3543/src/version.c 2021-10-19 22:12:21.936582330 +0100 --- src/version.c 2021-10-20 09:57:21.899860581 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3544, /**/ -- hundred-and-one symptoms of being an internet addict: 203. You're an active member of more than 20 newsgroups. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///