aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-14 23:24:28 -0800
committerDoug Hogan <[email protected]>2019-01-14 23:24:28 -0800
commit9ef96d08df6a55912dfbb8de2e460f719f5a6728 (patch)
tree8aec41f81ebf1f7e93fa4ebc49d1d5cb41e9f3cf /lib/crypto
parent825c73a0f8fdd27a37971a7bd7090356d2900565 (diff)
downloadotp-9ef96d08df6a55912dfbb8de2e460f719f5a6728.tar.gz
otp-9ef96d08df6a55912dfbb8de2e460f719f5a6728.tar.bz2
otp-9ef96d08df6a55912dfbb8de2e460f719f5a6728.zip
Make crypto_free() NULL safe
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/c_src/crypto_callback.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/crypto/c_src/crypto_callback.c b/lib/crypto/c_src/crypto_callback.c
index c0ca18e2ce..0141ccd840 100644
--- a/lib/crypto/c_src/crypto_callback.c
+++ b/lib/crypto/c_src/crypto_callback.c
@@ -92,6 +92,9 @@ static void* crypto_realloc(void* ptr, size_t size CCB_FILE_LINE_ARGS)
static void crypto_free(void* ptr CCB_FILE_LINE_ARGS)
{
+ if (ptr == NULL)
+ return;
+
enif_free(ptr);
}