summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-01-29 14:18:28 +0100
committerJim Meyering <jim@meyering.net>2007-01-29 14:18:28 +0100
commit449a3751d1e00b383ff70f6ca4516bef58ce260d (patch)
tree651d51e5df4007c00a482f35e8722a37c7223b03 /src
parente4eaba04dda577c401a07df0a56db2b03c809ee2 (diff)
downloadcoreutils-449a3751d1e00b383ff70f6ca4516bef58ce260d.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/ls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ls.c b/src/ls.c
index 4a6d7c1fb..dbcc83ef4 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;
}