From ad39174691b1902a1657bad05571c33f121227c0 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 12 Aug 2011 12:35:37 +0000 Subject: [PATCH] * fhandler_proc.cc (fhandler_proc::closedir): Don't free, but delete instead. Also fix previous ChangeLog entry. --- winsup/cygwin/ChangeLog | 12 ++++++++++-- winsup/cygwin/fhandler_proc.cc | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 933769a48..9c6ece819 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,10 +1,18 @@ +2011-08-12 Corinna Vinschen + + * fhandler_proc.cc (fhandler_proc::closedir): Don't free, but delete + instead. + 2011-08-12 Corinna Vinschen * fhandler.h (fhandler_proc::opendir): Declare. (fhandler_proc::closedir): Declare. * fhandler_proc.cc (fhandler_proc::opendir): New method. Fetch list - of active processes here once to avoid potential duplicates. - (fhandler_proc::closedir): New method. + of active processes here once to avoid potential duplicates and store + in dir->__handle. + (fhandler_proc::closedir): New method. Free dir->__handle. + (fhandler_proc::readdir): Convert pinfo into a reference to the winpids + entry in dir->__handle. 2011-08-11 Corinna Vinschen diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc index 94007cae1..74c4cf288 100644 --- a/winsup/cygwin/fhandler_proc.cc +++ b/winsup/cygwin/fhandler_proc.cc @@ -236,7 +236,7 @@ fhandler_proc::opendir (int fd) int fhandler_proc::closedir (DIR *dir) { - free (dir->__handle); + delete (winpids *) dir->__handle; return fhandler_virtual::closedir (dir); }