diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2014-10-22 15:47:19 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2014-10-22 15:47:19 +0000 |
commit | 1a626dea2c423653d8834cd32d058834fdea6ff9 (patch) | |
tree | 8a1a66f480f10310f552f0937437a3d9aa80e6cc | |
parent | 6be31969f60a0c5bfe125d8f8f084581e665816b (diff) |
Use reallocarray() instead of calloc() (originally was realloc).
OK deraadt@
-rw-r--r-- | lib/libc/rpc/svc_run.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index caab04195cf..85e6166a7ed 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc_run.c,v 1.20 2013/04/16 12:15:55 millert Exp $ */ +/* $OpenBSD: svc_run.c,v 1.21 2014/10/22 15:47:18 millert Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -50,8 +50,7 @@ svc_run(void) for (;;) { if (svc_max_pollfd > saved_max_pollfd) { - free(pfd); - pfd = calloc(sizeof(*pfd), svc_max_pollfd); + pfd = reallocarray(pfd, sizeof(*pfd), svc_max_pollfd); if (pfd == NULL) { perror("svc_run"); /* XXX */ return; /* XXX */ |