diff options
author | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2015-06-25 02:04:09 +0000 |
---|---|---|
committer | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2015-06-25 02:04:09 +0000 |
commit | 69ca20a1df7a5cae60e8a90e9ecdaa81dbc7dd9f (patch) | |
tree | 083a3e45855fcbcde924ba7d7fd54da0848124f3 /bin | |
parent | 6b9508aa7136f15ea18b368aa8e1e139837451b5 (diff) |
Put fts_close() where missing.
Not bugs in short-lived commands that call exit() -> _exit() immediately,
but for idempotency.
Originally found in ls(1) by Valgrind. Changes for other commands are
from deraadt@. Reviewed by me, tested in snapshots.
OK deraadt@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/chmod/chmod.c | 3 | ||||
-rw-r--r-- | bin/ls/ls.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c index a1d7c240beb..d855f89ebbb 100644 --- a/bin/chmod/chmod.c +++ b/bin/chmod/chmod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chmod.c,v 1.33 2014/12/13 20:59:24 guenther Exp $ */ +/* $OpenBSD: chmod.c,v 1.34 2015/06/25 02:04:08 uebayasi Exp $ */ /* $NetBSD: chmod.c,v 1.12 1995/03/21 09:02:09 cgd Exp $ */ /* @@ -278,6 +278,7 @@ done: } if (errno) err(1, "fts_read"); + fts_close(ftsp); exit(rval); } diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 2621788eaee..c4ef6592652 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ls.c,v 1.40 2015/04/18 18:28:36 deraadt Exp $ */ +/* $OpenBSD: ls.c,v 1.41 2015/06/25 02:04:07 uebayasi Exp $ */ /* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */ /* @@ -403,6 +403,8 @@ traverse(int argc, char *argv[], int options) } if (errno) err(1, "fts_read"); + + fts_close(ftsp); } /* |