mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-31 06:55:47 +03:00
coap_digest_free: Handle NULL pointer
This commit is contained in:
1 parent
1d465b6bde
commit
4c6ab62e9d
4 files changed
+10
-5
No files matched your search
+2
-1
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user