mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-14 03:37:38 -08:00
* sysdep.c (closedir): Don't free directory buffer if it looks
like it and the DIR were malloced together.
This commit is contained in:
parent
37fd7901b2
commit
1b929d2579
1 changed files with 5 additions and 1 deletions
|
|
@ -2927,7 +2927,11 @@ closedir (dirp)
|
|||
register DIR *dirp; /* stream from opendir */
|
||||
{
|
||||
sys_close (dirp->dd_fd);
|
||||
xfree ((char *) dirp->dd_buf); /* directory block defined in <dirent.h> */
|
||||
|
||||
/* 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 <dirent.h> */
|
||||
xfree ((char *) dirp);
|
||||
}
|
||||
#endif /* not AIX */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue