diff options
author | Rich Salz <rsalz@openssl.org> | 2016-02-08 10:11:56 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-08 11:09:16 -0500 |
commit | 43ecb9c35caed8623cfd83e7d893b8b67725feb7 (patch) | |
tree | 676696126afa484d7afeba51771fdc8d41cc04ab /crypto/hmac | |
parent | 4500a4cd4d89ba338ad796d39ccb9d94794cc0d7 (diff) | |
download | openssl-43ecb9c35caed8623cfd83e7d893b8b67725feb7.tar.gz |
GH641: Don't care openssl_zmalloc
Don't cast malloc-family return values.
Also found some places where (a) blank line was missing; and (b)
the *wrong* return value was checked.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/hmac')
-rw-r--r-- | crypto/hmac/hmac.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index f372955c60..9504aada94 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -171,12 +171,14 @@ size_t HMAC_size(HMAC_CTX *ctx) HMAC_CTX *HMAC_CTX_new(void) { - HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); - if (ctx) + HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX)); + + if (ctx != NULL) { if (!HMAC_CTX_reset(ctx)) { HMAC_CTX_free(ctx); - ctx = NULL; + return NULL; } + } return ctx; } |