Match new openssl HMAC_CTX_new better and zero out all the fields.
This commit is contained in:
parent
bb64310352
commit
2272657d65
|
@ -105,7 +105,7 @@ void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
|
|||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
static inline HMAC_CTX *HMAC_CTX_new(void)
|
||||
{
|
||||
HMAC_CTX *ctx = malloc(sizeof(*ctx));
|
||||
HMAC_CTX *ctx = calloc(1, sizeof(*ctx));
|
||||
if (ctx == NULL)
|
||||
return NULL;
|
||||
HMAC_CTX_init(ctx);
|
||||
|
|
|
@ -105,7 +105,7 @@ void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
|
|||
#ifdef OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
static inline HMAC_CTX *HMAC_CTX_new(void)
|
||||
{
|
||||
HMAC_CTX *ctx = malloc(sizeof(*ctx));
|
||||
HMAC_CTX *ctx = calloc(1, sizeof(*ctx));
|
||||
if (ctx == NULL)
|
||||
return NULL;
|
||||
HMAC_CTX_init(ctx);
|
||||
|
|
Loading…
Reference in New Issue