summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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