diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index e696cb3d352..2bbdf2640f2 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -2927,7 +2927,11 @@ closedir (dirp) | |||
| 2927 | register DIR *dirp; /* stream from opendir */ | 2927 | register DIR *dirp; /* stream from opendir */ |
| 2928 | { | 2928 | { |
| 2929 | sys_close (dirp->dd_fd); | 2929 | sys_close (dirp->dd_fd); |
| 2930 | xfree ((char *) dirp->dd_buf); /* directory block defined in <dirent.h> */ | 2930 | |
| 2931 | /* Some systems allocate the buffer and the DIR all in one block. | ||
| 2932 | Why in the world are we freeing this ourselves anyway? */ | ||
| 2933 | if (dirp->dd_buf != (char *)(dirp + 1)) | ||
| 2934 | xfree ((char *) dirp->dd_buf); /* directory block defined in <dirent.h> */ | ||
| 2931 | xfree ((char *) dirp); | 2935 | xfree ((char *) dirp); |
| 2932 | } | 2936 | } |
| 2933 | #endif /* not AIX */ | 2937 | #endif /* not AIX */ |