aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/uniq.c
diff options
context:
space:
mode:
authorAshwini Sharma <ak.ashwini1981@gmail.com>2014-08-12 07:09:01 -0500
committerAshwini Sharma <ak.ashwini1981@gmail.com>2014-08-12 07:09:01 -0500
commit7eb3e4364c2bcebd2fdfef52c07f5101aa03e5bb (patch)
tree3a71927fe5198488d24af53b030d71797b67de35 /toys/posix/uniq.c
parent6a77734d1b1ac1938abbc33014b60cfb49828824 (diff)
downloadtoybox-7eb3e4364c2bcebd2fdfef52c07f5101aa03e5bb.tar.gz
Patches to commands for issues reported from static analysis tool.
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it. Makefile.patch - for cleaning generated/*.o files and libopts.dat file [Fixup to uniq.c from Rob.]
Diffstat (limited to 'toys/posix/uniq.c')
-rw-r--r--toys/posix/uniq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/toys/posix/uniq.c b/toys/posix/uniq.c
index bd41d4af..3cfdb947 100644
--- a/toys/posix/uniq.c
+++ b/toys/posix/uniq.c
@@ -113,6 +113,8 @@ void uniq_main(void)
print_line(outfile, prevline);
if (CFG_TOYBOX_FREE) {
+ if (outfile != stdout) fclose(outfile);
+ if (infile != stdin) fclose(infile);
free(prevline);
free(thisline);
}