From 7807cb2439e1e5b2b1026f2a7fc95c602b8b1c68 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Sat, 5 Jun 2004 02:32:21 +0000 Subject: [PATCH] Plug file descriptor leak in implementation of -n option. --- bin/cp/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 97695919ec6d..7ad8788cae50 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",