summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/rcp/rcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index d36f3bd..62d7daf 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -403,7 +403,8 @@ syserr: run_err("%s: %s", name, strerror(errno));
if (response() < 0)
goto next;
if ((bp = allocbuf(&buffer, fd, BUFSIZ)) == NULL) {
-next: (void)close(fd);
+next: if (fd >= 0)
+ (void)close(fd);
continue;
}
OpenPOWER on IntegriCloud