From: Jim Meyering Date: Mon, 29 Dec 1997 21:04:26 +0000 (+0000) Subject: (remove_cwd_entries): Plug a gross leak -- don't call X-Git-Tag: v4.5.1~8983 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cc8090de237d5c765b7096278c9af3eb6089de1;p=thirdparty%2Fcoreutils.git (remove_cwd_entries): Plug a gross leak -- don't call obstack_init inside the loop. --- diff --git a/src/rm.c b/src/rm.c index 476a0ab3e4..2da31aeb81 100644 --- a/src/rm.c +++ b/src/rm.c @@ -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