coap_digest_free: Handle NULL pointer

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2024-11-23 12:16:27 +00:00
1 parent 1d465b6bde
commit 4c6ab62e9d
4 files changed
+10 -5

No files matched your search

+2 -1
View File
@@ -2964,7 +2964,8 @@ coap_digest_setup(void) {
void
coap_digest_free(coap_digest_ctx_t *digest_ctx) {
gnutls_hash_deinit(digest_ctx, NULL);
if (digest_ctx)
gnutls_hash_deinit(digest_ctx, NULL);
}
int
+4 -2
View File
@@ -2880,8 +2880,10 @@ coap_digest_setup(void) {
void
coap_digest_free(coap_digest_ctx_t *digest_ctx) {
mbedtls_sha256_free(digest_ctx);
mbedtls_free(digest_ctx);
if (digest_ctx) {
mbedtls_sha256_free(digest_ctx);
mbedtls_free(digest_ctx);
}
}
int
+2 -1
View File
@@ -4082,7 +4082,8 @@ coap_digest_setup(void) {
void
coap_digest_free(coap_digest_ctx_t *digest_ctx) {
EVP_MD_CTX_free(digest_ctx);
if (digest_ctx)
EVP_MD_CTX_free(digest_ctx);
}
int
+2 -1
View File
@@ -2859,7 +2859,8 @@ coap_digest_setup(void) {
void
coap_digest_free(coap_digest_ctx_t *digest_ctx) {
wolfSSL_EVP_MD_CTX_free(digest_ctx);
if (digest_ctx)
wolfSSL_EVP_MD_CTX_free(digest_ctx);
}
int