summaryrefslogtreecommitdiff
path: root/lib/libcrypto/lhash/lhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/lhash/lhash.c')
-rw-r--r--lib/libcrypto/lhash/lhash.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libcrypto/lhash/lhash.c b/lib/libcrypto/lhash/lhash.c
index 1e3359cfe06..932391fa1e6 100644
--- a/lib/libcrypto/lhash/lhash.c
+++ b/lib/libcrypto/lhash/lhash.c
@@ -337,8 +337,7 @@ expand(_LHASH *lh)
if ((lh->p) >= lh->pmax) {
j = (int)lh->num_alloc_nodes * 2;
- n = (LHASH_NODE **)realloc(lh->b,
- (int)(sizeof(LHASH_NODE *) * j));
+ n = reallocarray(lh->b, j, sizeof(LHASH_NODE *));
if (n == NULL) {
/* fputs("realloc error in lhash", stderr); */
lh->error++;
@@ -364,8 +363,7 @@ contract(_LHASH *lh)
np = lh->b[lh->p + lh->pmax - 1];
lh->b[lh->p+lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
if (lh->p == 0) {
- n = (LHASH_NODE **)realloc(lh->b,
- (unsigned int)(sizeof(LHASH_NODE *) * lh->pmax));
+ n = reallocarray(lh->b, lh->pmax, sizeof(LHASH_NODE *));
if (n == NULL) {
/* fputs("realloc error in lhash", stderr); */
lh->error++;