summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/getnetconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc/getnetconfig.c')
-rw-r--r--lib/libc/rpc/getnetconfig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/getnetconfig.c b/lib/libc/rpc/getnetconfig.c
index 6d504c5..40e5a1b 100644
--- a/lib/libc/rpc/getnetconfig.c
+++ b/lib/libc/rpc/getnetconfig.c
@@ -630,8 +630,8 @@ parse_ncp(char *stringp, struct netconfig *ncp)
ncp->nc_lookups = NULL;
ncp->nc_nlookups = 0;
while ((cp = tokenp) != NULL) {
- if ((nc_lookups = realloc(ncp->nc_lookups,
- (ncp->nc_nlookups + 1) * sizeof *ncp->nc_lookups)) == NULL) {
+ if ((nc_lookups = reallocarray(ncp->nc_lookups,
+ ncp->nc_nlookups + 1, sizeof(*ncp->nc_lookups))) == NULL) {
free(ncp->nc_lookups);
ncp->nc_lookups = NULL;
return (-1);
OpenPOWER on IntegriCloud