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 /usr.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 'usr.bin')
-rw-r--r-- | usr.bin/compress/main.c | 4 | ||||
-rw-r--r-- | usr.bin/du/du.c | 3 | ||||
-rw-r--r-- | usr.bin/grep/util.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c index 4d91398b9a3..e9487918afa 100644 --- a/usr.bin/compress/main.c +++ b/usr.bin/compress/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.84 2015/05/03 19:44:59 guenther Exp $ */ +/* $OpenBSD: main.c,v 1.85 2015/06/25 02:04:08 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -463,7 +463,7 @@ main(int argc, char *argv[]) } if (list) list_stats(NULL, NULL, NULL); - + fts_close(ftsp); exit(rc); } diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index ce223066ce2..51f48360e53 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -1,4 +1,4 @@ -/* $OpenBSD: du.c,v 1.29 2014/10/20 22:13:11 schwarze Exp $ */ +/* $OpenBSD: du.c,v 1.30 2015/06/25 02:04:08 uebayasi Exp $ */ /* $NetBSD: du.c,v 1.11 1996/10/18 07:20:35 thorpej Exp $ */ /* @@ -206,6 +206,7 @@ main(int argc, char *argv[]) if (cflag) { prtout((quad_t)howmany(totalblocks, blocksize), "total", hflag); } + fts_close(fts); exit(rval); } diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index c4b945d4b36..39afe182dd4 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.49 2014/12/01 06:36:04 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.50 2015/06/25 02:04:08 uebayasi Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -85,7 +85,7 @@ grep_tree(char **argv) } if (errno) err(2, "fts_read"); - + fts_close(fts); return c; } |