Index: debug.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/debug.h,v retrieving revision 1.20 diff -u -r1.20 debug.h --- debug.h 3 Aug 2002 23:43:42 -0000 1.20 +++ debug.h 6 Aug 2002 02:57:52 -0000 @@ -81,7 +81,6 @@ struct handle_list { - BOOL allocated; HANDLE h; const char *name; const char *func; Index: debug.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/debug.cc,v retrieving revision 1.38 diff -u -r1.38 debug.cc --- debug.cc 1 Aug 2002 16:20:31 -0000 1.38 +++ debug.cc 6 Aug 2002 02:57:52 -0000 @@ -101,17 +101,9 @@ for (hl = cygheap->debug.freeh; hl < cygheap->debug.freeh + NFREEH; hl++) if (hl->name == NULL) - goto out; + return hl; - /* All used up??? */ - if ((hl = (handle_list *) malloc (sizeof *hl)) != NULL) - { - memset (hl, 0, sizeof (*hl)); - hl->allocated = TRUE; - } - -out: - return hl; + return NULL; } /* Add a handle to the linked list of known handles. */ @@ -136,8 +128,8 @@ if ((hl = newh ()) == NULL) { here.unlock (); - system_printf ("couldn't allocate memory for %s(%d): %s(%p)", - func, ln, name, h); + debug_printf ("couldn't allocate memory for %s(%d): %s(%p)", + func, ln, name, h); return; } hl->h = h; @@ -160,10 +152,7 @@ handle_list *hnuke = hl->next; debug_printf ("nuking handle '%s'", hnuke->name); hl->next = hl->next->next; - if (hnuke->allocated) - free (hnuke); - else - memset (hnuke, 0, sizeof (*hnuke)); + memset (hnuke, 0, sizeof (*hnuke)); } void