diff options
author | Richard Levitte <levitte@openssl.org> | 2015-03-24 12:16:31 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-03-24 12:21:12 +0100 |
commit | 2383a74be14d26d57bf7e56a2f2688705577d5e7 (patch) | |
tree | 8a6ae1400b12ae6caae30abfefe8c326c7a25b22 /crypto | |
parent | 912d7c75d41a36bac2371f4e3a440eca86b6489b (diff) | |
download | openssl-2383a74be14d26d57bf7e56a2f2688705577d5e7.tar.gz |
Use OPENSSL_malloc rather than malloc/calloc
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/engine/eng_cryptodev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c index 6f66254c9e..d005e017e4 100644 --- a/crypto/engine/eng_cryptodev.c +++ b/crypto/engine/eng_cryptodev.c @@ -1022,9 +1022,10 @@ static int bn2crparam(const BIGNUM *a, struct crparam *crp) bits = BN_num_bits(a); bytes = BN_num_bytes(a); - b = calloc(bytes,1); + b = OPENSSL_malloc(bytes); if (b == NULL) return (1); + memset(b, 0, bytes); crp->crp_p = (caddr_t) b; crp->crp_nbits = bits; @@ -1044,7 +1045,7 @@ static int crparam2bn(struct crparam *crp, BIGNUM *a) if (bytes == 0) return (-1); - if ((pd = (u_int8_t *) malloc(bytes)) == NULL) + if ((pd = (u_int8_t *) OPENSSL_malloc(bytes)) == NULL) return (-1); for (i = 0; i < bytes; i++) |