Module: kamailio
Branch: master
Commit: 316b2eb4ae5b8e59e2c4ddabf4e508435977f00f
URL: 
https://github.com/kamailio/kamailio/commit/316b2eb4ae5b8e59e2c4ddabf4e508435977f00f

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-06-29T10:51:28+02:00

gcrypt: extend the check on context for destroy

---

Modified: src/modules/gcrypt/gcrypt_aes128.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/316b2eb4ae5b8e59e2c4ddabf4e508435977f00f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/316b2eb4ae5b8e59e2c4ddabf4e508435977f00f.patch

---

diff --git a/src/modules/gcrypt/gcrypt_aes128.c 
b/src/modules/gcrypt/gcrypt_aes128.c
index c51a9a1243c..4bdef0cf746 100644
--- a/src/modules/gcrypt/gcrypt_aes128.c
+++ b/src/modules/gcrypt/gcrypt_aes128.c
@@ -50,7 +50,7 @@ void *aes128_context_init(uint8_t key[16])
 
 void aes128_context_destroy(void **context)
 {
-       if(context != NULL) {
+       if(context != NULL && *context != NULL) {
                gcry_cipher_close(*context);
                *context = NULL;
        }

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to