mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
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.
This commit is contained in:
1 parent
e4eaba04dd
commit
449a3751d1
2 files changed
+6
No files matched your search
@@ -1,5 +1,9 @@
|
||||
2007-01-29 Jim Meyering <jim@meyering.net>
|
||||
|
||||
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.
|
||||
|
||||
* src/ls.c: Rename three global variables.
|
||||
(cwd_file): Rename from 'files'.
|
||||
(cwd_n_alloc): Rename from 'nfiles'.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user