diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-08-20 22:16:36 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-08-20 22:16:36 +0000 |
commit | b898cc0a31a65e677e1b11a12abbbfd19173fe57 (patch) | |
tree | 73681cc308268a1a23479026fc0b990f50c55ebd | |
parent | d22e397e4b8f49072b655fb520c15732129ed03d (diff) |
Two reallocarray() conversions that were missed earlier.
OK deraadt@
-rw-r--r-- | sbin/mountd/mountd.c | 4 | ||||
-rw-r--r-- | sbin/pdisk/dump.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 06e2b94bd0a..6ec1a89f8cd 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.80 2015/08/20 22:02:21 deraadt Exp $ */ +/* $OpenBSD: mountd.c,v 1.81 2015/08/20 22:16:35 millert Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -1466,7 +1466,7 @@ get_host(char *cp, struct grouplist *grp, struct grouplist *tgrp) i = 1; while (*addrp++) i++; - naddrp = nhp->h_addr_list = malloc(i*sizeof(char *)); + naddrp = nhp->h_addr_list = reallocarray(NULL, i, sizeof(char *)); if (naddrp == NULL) out_of_mem(); addrp = hp->h_addr_list; diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c index 935d01a03cd..b6bd3adb918 100644 --- a/sbin/pdisk/dump.c +++ b/sbin/pdisk/dump.c @@ -695,7 +695,7 @@ display_patches(partition_map *entry) if (p->numPatchBlocks != 1) { i = p->numPatchBlocks; free(patch_block); - patch_block = malloc(PBLOCK_SIZE*i); + patch_block = reallocarray(NULL, i, PBLOCK_SIZE); if (patch_block == NULL) { error(errno, "can't allocate memory for patch blocks buffer"); return; |