4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-21 00:07:36 +08:00

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>
This commit is contained in:
Corinna Vinschen 2024-03-20 14:48:55 +01:00
parent 205190a80b
commit 8bd6ba8f16

View File

@ -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);