From 142c109909e43606312885dad233fc1a74a547d4 Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Fri, 4 Jan 2019 01:23:26 -0800 Subject: Revamp evp_compat HMAC_CTX_free() * Allow for calling with NULL. --- lib/crypto/c_src/evp_compat.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/crypto/c_src') diff --git a/lib/crypto/c_src/evp_compat.h b/lib/crypto/c_src/evp_compat.h index c81d1e35ee..e289ce5e76 100644 --- a/lib/crypto/c_src/evp_compat.h +++ b/lib/crypto/c_src/evp_compat.h @@ -48,6 +48,9 @@ static INLINE HMAC_CTX *HMAC_CTX_new() static INLINE void HMAC_CTX_free(HMAC_CTX *ctx) { + if (ctx == NULL) + return; + HMAC_CTX_cleanup(ctx); CRYPTO_free(ctx); } -- cgit v1.2.3