diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-28 15:28:14 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-28 15:28:14 -0400 |
commit | b196e7d936fb377d9c5b305748ac25ff0e53ef6d (patch) | |
tree | c855f0808899e5e7ef3a704c35f464ca36014964 /crypto/lhash/lhash.c | |
parent | 3e47caff4830d2a117eda15b57a5feab89b846ae (diff) |
remove malloc casts
Following ANSI C rules, remove the casts from calls to
OPENSSL_malloc and OPENSSL_realloc.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/lhash/lhash.c')
-rw-r--r-- | crypto/lhash/lhash.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c index 5e9bfb8b1c..ac3b5f607b 100644 --- a/crypto/lhash/lhash.c +++ b/crypto/lhash/lhash.c @@ -188,7 +188,7 @@ void *lh_insert(_LHASH *lh, void *data) rn = getrn(lh, data, &hash); if (*rn == NULL) { - if ((nn = (LHASH_NODE *)OPENSSL_malloc(sizeof(LHASH_NODE))) == NULL) { + if ((nn = OPENSSL_malloc(sizeof(LHASH_NODE))) == NULL) { lh->error++; return (NULL); } @@ -325,15 +325,13 @@ static void expand(_LHASH *lh) if ((lh->p) >= lh->pmax) { j = (int)lh->num_alloc_nodes * 2; - n = (LHASH_NODE **)OPENSSL_realloc(lh->b, - (int)(sizeof(LHASH_NODE *) * j)); + n = OPENSSL_realloc(lh->b, (int)(sizeof(LHASH_NODE *) * j)); if (n == NULL) { -/* fputs("realloc error in lhash",stderr); */ + /* fputs("realloc error in lhash",stderr); */ lh->error++; lh->p = 0; return; } - /* else */ for (i = (int)lh->num_alloc_nodes; i < j; i++) /* 26/02/92 eay */ n[i] = NULL; /* 02/03/92 eay */ lh->pmax = lh->num_alloc_nodes; @@ -351,11 +349,10 @@ static void 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 **)OPENSSL_realloc(lh->b, - (unsigned int)(sizeof(LHASH_NODE *) - * lh->pmax)); + n = OPENSSL_realloc(lh->b, + (unsigned int)(sizeof(LHASH_NODE *) * lh->pmax)); if (n == NULL) { -/* fputs("realloc error in lhash",stderr); */ + /* fputs("realloc error in lhash",stderr); */ lh->error++; return; } |