mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-08-17 09:06:50 +02:00
(remove_cwd_entries): Plug a gross leak -- don't call
obstack_init inside the loop.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user