aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-04 01:23:26 -0800
committerDoug Hogan <[email protected]>2019-01-08 01:11:58 -0800
commit142c109909e43606312885dad233fc1a74a547d4 (patch)
tree9cc7d77e373c5e178fe238f3e3036f8aa35b58a7 /lib
parent83fc1366cfd005b3fb8ce18e40af83f5f6f2818f (diff)
downloadotp-142c109909e43606312885dad233fc1a74a547d4.tar.gz
otp-142c109909e43606312885dad233fc1a74a547d4.tar.bz2
otp-142c109909e43606312885dad233fc1a74a547d4.zip
Revamp evp_compat HMAC_CTX_free()
* Allow for calling with NULL.
Diffstat (limited to 'lib')
-rw-r--r--lib/crypto/c_src/evp_compat.h3
1 files changed, 3 insertions, 0 deletions
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);
}