summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-10-08 05:29:07 +0000
committerderaadt <deraadt@openbsd.org>2014-10-08 05:29:07 +0000
commit368e9d9b0628f2ea8ecf35ee88556ca8c3d2e934 (patch)
treef7367e1e0cd980238699a6abbc2eb6bdab355e40 /lib/libc
parentobvious reallocarray(); ok doug (diff)
downloadwireguard-openbsd-368e9d9b0628f2ea8ecf35ee88556ca8c3d2e934.tar.xz
wireguard-openbsd-368e9d9b0628f2ea8ecf35ee88556ca8c3d2e934.zip
obvious conversion of realloc() to reallocarray(). Luckily this is
using pollfd, because if this was fd_set... it would not be obvious (or easy)
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/rpc/svc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c
index 1b3a754dbcd..c9a59907baa 100644
--- a/lib/libc/rpc/svc.c
+++ b/lib/libc/rpc/svc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svc.c,v 1.25 2010/09/01 14:43:34 millert Exp $ */
+/* $OpenBSD: svc.c,v 1.26 2014/10/08 05:29:07 deraadt Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -144,7 +144,7 @@ svc_fd_insert(int sock)
int new_size, *new_freelist;
new_size = svc_pollfd ? svc_pollfd_size + 128 : FD_SETSIZE;
- pfd = realloc(svc_pollfd, sizeof(*svc_pollfd) * new_size);
+ pfd = reallocarray(svc_pollfd, new_size, sizeof(*svc_pollfd));
if (pfd == NULL)
return (0); /* no changes */
new_freelist = realloc(svc_pollfd_freelist, new_size / 2);