# HG changeset patch # User Jim Blandy # Date 740262661 0 # Node ID e0be9df19ee154d024288302cd75eb2dc081a2e4 # Parent 03636746095585ba5c0b62925c768256478890b8 * sysdep.c (closedir): Don't free directory buffer if it looks like it and the DIR were malloced together. diff -r 036367460955 -r e0be9df19ee1 src/sysdep.c --- a/src/sysdep.c Wed Jun 16 20:02:58 1993 +0000 +++ b/src/sysdep.c Wed Jun 16 20:31:01 1993 +0000 @@ -2927,7 +2927,11 @@ register DIR *dirp; /* stream from opendir */ { sys_close (dirp->dd_fd); - xfree ((char *) dirp->dd_buf); /* directory block defined in */ + + /* Some systems allocate the buffer and the DIR all in one block. + Why in the world are we freeing this ourselves anyway? */ + if (dirp->dd_buf != (char *)(dirp + 1)) + xfree ((char *) dirp->dd_buf); /* directory block defined in */ xfree ((char *) dirp); } #endif /* not AIX */