diff options
author | 2006-09-22 18:42:04 +0000 | |
---|---|---|
committer | 2006-09-22 18:42:04 +0000 | |
commit | 58884eaa3f49f4acfd4177ba3b9898a2ce73a8ea (patch) | |
tree | 9b4122d8f9c7cc7a511790cbeed2fc98f3d4c1a5 | |
parent | add blocked_close, blocked_dup2, close_race and dup2_race (diff) | |
download | wireguard-openbsd-58884eaa3f49f4acfd4177ba3b9898a2ce73a8ea.tar.xz wireguard-openbsd-58884eaa3f49f4acfd4177ba3b9898a2ce73a8ea.zip |
Check return value of authunix_create_default(); from bret lambert
with some guidance by me; ok jaredy@
-rw-r--r-- | lib/libc/rpc/pmap_rmt.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index 1356b3fd15a..76adaddd2a3 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_rmt.c,v 1.26 2006/03/31 17:31:59 deraadt Exp $ */ +/* $OpenBSD: pmap_rmt.c,v 1.27 2006/09/22 18:42:04 otto Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -208,7 +208,7 @@ clnt_broadcast(u_long prog, /* program number */ resultproc_t eachresult) /* call with each result obtained */ { enum clnt_stat stat; - AUTH *unix_auth = authunix_create_default(); + AUTH *unix_auth; XDR xdr_stream; XDR *xdrs = &xdr_stream; int outlen, inlen, nets; @@ -228,6 +228,11 @@ clnt_broadcast(u_long prog, /* program number */ struct rpc_msg msg; char outbuf[MAX_BROADCAST_SIZE], inbuf[UDPMSGSIZE]; + if ((unix_auth = authunix_create_default()) == NULL) { + stat = RPC_AUTHERROR; + goto done_broad; + } + /* * initialization: create a socket, a broadcast address, and * preserialize the arguments into a send buffer. @@ -371,6 +376,7 @@ done_broad: free(addrs); if (sock >= 0) (void)close(sock); - AUTH_DESTROY(unix_auth); + if (unix_auth != NULL) + AUTH_DESTROY(unix_auth); return (stat); } |