I've just checked in this change:

        Plug a leak in ls.
        * src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
        determine dev/inode or upon detecting a symlink loop.

diff --git a/src/ls.c b/src/ls.c
index 4a6d7c1..dbcc83e 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2342,6 +2342,7 @@ print_dir (char const *name, char const *realname, bool 
command_line_arg)
        {
          file_failure (command_line_arg,
                        _("cannot determine device and inode of %s"), name);
+         closedir (dirp);
          return;
        }

@@ -2351,6 +2352,7 @@ print_dir (char const *name, char const *realname, bool 
command_line_arg)
        {
          error (0, 0, _("%s: not listing already-listed directory"),
                 quotearg_colon (name));
+         closedir (dirp);
          return;
        }


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to