summaryrefslogtreecommitdiffstats
path: root/bin/cp
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-06-05 02:32:21 +0000
committertjr <tjr@FreeBSD.org>2004-06-05 02:32:21 +0000
commit6dc95a961446a2fbc6bb672da914ef24abb323fd (patch)
treec4a8df292e182f2d53c7c414e84786feb9899a05 /bin/cp
parent02a7d287a2f48d1a130773559be6fe4b5a9250c0 (diff)
downloadFreeBSD-src-6dc95a961446a2fbc6bb672da914ef24abb323fd.zip
FreeBSD-src-6dc95a961446a2fbc6bb672da914ef24abb323fd.tar.gz
Plug file descriptor leak in implementation of -n option.
Diffstat (limited to 'bin/cp')
-rw-r--r--bin/cp/utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index 9769591..7ad8788 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -88,6 +88,7 @@ copy_file(const FTSENT *entp, int dne)
if (nflag) {
if (vflag)
printf("%s not overwritten\n", to.p_path);
+ (void)close(from_fd);
return (0);
} else if (iflag) {
(void)fprintf(stderr, "overwrite %s? %s",
OpenPOWER on IntegriCloud