diff options
author | Jim Meyering <jim@meyering.net> | 1997-12-29 21:04:26 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-12-29 21:04:26 +0000 |
commit | 5cc8090de237d5c765b7096278c9af3eb6089de1 (patch) | |
tree | 205d540521fc6d5ed62fa15dcbb3fb19d1f865a0 /src | |
parent | e2ed51f99ebba522607ae4bbac83caf5dadbbd00 (diff) | |
download | coreutils-5cc8090de237d5c765b7096278c9af3eb6089de1.tar.xz |
(remove_cwd_entries): Plug a gross leak -- don't call
obstack_init inside the loop.
Diffstat (limited to 'src')
-rw-r--r-- | src/rm.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -533,6 +533,8 @@ remove_cwd_entries (void) enum RM_status status = RM_OK; + obstack_init (&entry_name_pool); + if (dirp) { if (CLOSEDIR (dirp)) @@ -567,8 +569,6 @@ remove_cwd_entries (void) enum RM_status tmp_status; struct dirent *dp; - obstack_init (&entry_name_pool); - /* FILE should be skipped if it is `.' or `..', or if it is in the table, HT, of entries we've already processed. */ #define SKIPPABLE(Ht, File) (DOT_OR_DOTDOT(File) \ @@ -593,8 +593,7 @@ remove_cwd_entries (void) dp = readdir (dirp); -/* FIXME: add autoconf test to detect this. */ -#ifndef HAVE_WORKING_READDIR +#if ! HAVE_WORKING_READDIR if (dp == NULL) { /* Since we have probably modified the directory since it |