commit | 9ac3e23f5dff2787bb82c504166b60d03f0a94c1 | [log] [tgz] |
---|---|---|
author | Troy-Butler <squintik@outlook.com> | Fri Mar 22 14:46:04 2024 -0400 |
committer | Troy-Butler <squintik@outlook.com> | Fri Mar 22 14:46:04 2024 -0400 |
tree | e3e86a6129c7e6fbc2abcf62bf81532feba977cd | |
parent | 611f899c0c9d397baedfaec34ea0861ad2543991 [diff] [blame] |
Fix NULL argument handling in mbedtls_xxx_free() functions Signed-off-by: Troy-Butler <squintik@outlook.com>
diff --git a/library/nist_kw.c b/library/nist_kw.c index f15425b..8faafe4 100644 --- a/library/nist_kw.c +++ b/library/nist_kw.c
@@ -102,6 +102,10 @@ */ void mbedtls_nist_kw_free(mbedtls_nist_kw_context *ctx) { + if (ctx == NULL) { + return; + } + mbedtls_cipher_free(&ctx->cipher_ctx); mbedtls_platform_zeroize(ctx, sizeof(mbedtls_nist_kw_context)); }