This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

memory leak in cygheap


Hi!

  this simple program:

#include <sys/types.h>
#include <dirent.h>

int main ()
{
  DIR* x = 0;
  for (;;)
    {
      x = opendir ("/");
      closedir (x);
    }
  return 0;
}

leaks memory and eventually dies with "can't allocate cygwin heap"
error message.

attached patch fix this.
do we need this "no free names" logic at all? the only suspicious
place is fhandler_disk_file::open () where we were storing pointer to
real_path's win32_path, so if it was changing later we were staying in
sync with those changes. but i can't see why it may change after open
is called, so making duplicate looks safe for me. Comments?

egor.            mailto:deo@logos-m.ru icq 5165414 fidonet 2:5020/496.19

cygheap-leak.diff

cygheap-leak.ChangeLog


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]