Fix NULL argument handling in mbedtls_xxx_free() functions
Signed-off-by: Troy-Butler <squintik@outlook.com>
diff --git a/library/entropy.c b/library/entropy.c
index e3bc851..7dcf067 100644
--- a/library/entropy.c
+++ b/library/entropy.c
@@ -61,6 +61,10 @@
void mbedtls_entropy_free(mbedtls_entropy_context *ctx)
{
+ if (ctx == NULL) {
+ return;
+ }
+
/* If the context was already free, don't call free() again.
* This is important for mutexes which don't allow double-free. */
if (ctx->accumulator_started == -1) {