This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
memory leak in cygheap
- To: cygwin-patches at cygwin dot com
- Subject: memory leak in cygheap
- From: egor duda <deo at logos-m dot ru>
- Date: Thu, 27 Sep 2001 20:51:56 +0400
- Organization: deo
- Reply-To: egor duda <cygwin-patches at cygwin dot com>
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