diff options
author | 2009-06-06 03:28:34 +0000 | |
---|---|---|
committer | 2009-06-06 03:28:34 +0000 | |
commit | cadf1d426c1693d1bd4938811a36563c22eb6d25 (patch) | |
tree | a26ab1cfb4cbc91b1407fd92ec6b001a1d19e995 /lib/libc/rpc/xdr_reference.c | |
parent | if smtpctl is run in unsupported mode, exit with a warning instead of (diff) | |
download | wireguard-openbsd-cadf1d426c1693d1bd4938811a36563c22eb6d25.tar.xz wireguard-openbsd-cadf1d426c1693d1bd4938811a36563c22eb6d25.zip |
use calloc() and realloc() more; ok schwarze
Diffstat (limited to 'lib/libc/rpc/xdr_reference.c')
-rw-r--r-- | lib/libc/rpc/xdr_reference.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/rpc/xdr_reference.c b/lib/libc/rpc/xdr_reference.c index 57159c2c1f9..9d41b003f18 100644 --- a/lib/libc/rpc/xdr_reference.c +++ b/lib/libc/rpc/xdr_reference.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_reference.c,v 1.7 2005/08/08 08:05:36 espie Exp $ */ +/* $OpenBSD: xdr_reference.c,v 1.8 2009/06/06 03:28:34 deraadt 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 @@ -67,13 +67,12 @@ xdr_reference(XDR *xdrs, return (TRUE); case XDR_DECODE: - *pp = loc = (caddr_t) mem_alloc(size); + *pp = loc = (caddr_t) calloc(size, 1); if (loc == NULL) { (void) fprintf(stderr, "xdr_reference: out of memory\n"); return (FALSE); } - memset(loc, 0, (int)size); break; } |