]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: /proc: fix mem leak in opendir in error case
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 20 Mar 2024 13:48:55 +0000 (14:48 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 20 Mar 2024 13:48:55 +0000 (14:48 +0100)
Fixes: 1f08558f14e45 ("* fhandler.h (fhandler_proc::opendir): Declare.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler/proc.cc

index cb754185b833b5ace256ffdf2c050bedc07dd7c7..a508d4b14d942d7a4942dd7c3bbaddf0bb77087f 100644 (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);
This page took 0.033846 seconds and 5 git commands to generate.