aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2024-03-20 14:48:55 +0100
committerCorinna Vinschen <corinna@vinschen.de>2024-03-20 14:48:55 +0100
commit8bd6ba8f16ec7ae07118d5f0d552efe421b008a5 (patch)
treee3ee00895a13207892c8a9111d7512b48b678c9e
parent205190a80bd0b50b8b34768fe298411d6bde2e25 (diff)
downloadnewlib-8bd6ba8f16ec7ae07118d5f0d552efe421b008a5.zip
newlib-8bd6ba8f16ec7ae07118d5f0d552efe421b008a5.tar.gz
newlib-8bd6ba8f16ec7ae07118d5f0d552efe421b008a5.tar.bz2
Cygwin: /proc: fix mem leak in opendir in error case
Fixes: 1f08558f14e45 ("* fhandler.h (fhandler_proc::opendir): Declare.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/fhandler/proc.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler/proc.cc b/winsup/cygwin/fhandler/proc.cc
index cb75418..a508d4b 100644
--- a/winsup/cygwin/fhandler/proc.cc
+++ b/winsup/cygwin/fhandler/proc.cc
@@ -243,6 +243,8 @@ fhandler_proc::opendir (int fd)
DIR *dir = fhandler_virtual::opendir (fd);
if (dir && !(dir->__handle = (void *) new winpids ((DWORD) 0)))
{
+ free (dir->__d_dirname);
+ free (dir->__d_dirent);
free (dir);
dir = NULL;
set_errno (ENOMEM);