diff options
author | 1996-12-10 07:46:33 +0000 | |
---|---|---|
committer | 1996-12-10 07:46:33 +0000 | |
commit | 648514c205965acdb89a3aac07861656502afe14 (patch) | |
tree | 465f2b986c37674779937acfc7fac4737c2a82b6 /lib/libc/rpc/clnt_tcp.c | |
parent | use MAXHOSTNAMELEN (diff) | |
download | wireguard-openbsd-648514c205965acdb89a3aac07861656502afe14.tar.xz wireguard-openbsd-648514c205965acdb89a3aac07861656502afe14.zip |
avoid close(-1) cases
Diffstat (limited to 'lib/libc/rpc/clnt_tcp.c')
-rw-r--r-- | lib/libc/rpc/clnt_tcp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index 694ebeb7f53..3cc332244ad 100644 --- a/lib/libc/rpc/clnt_tcp.c +++ b/lib/libc/rpc/clnt_tcp.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.10 1996/11/14 06:17:36 etheisen Exp $"; +static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.11 1996/12/10 07:46:37 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -163,7 +163,8 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) sizeof(*raddr)) < 0)) { rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; - (void)close(*sockp); + if (*sockp != -1) + (void)close(*sockp); goto fooy; } ct->ct_closeit = TRUE; |