Module: kamailio Branch: 4.3 Commit: 1c6fcd1bc43165cd9a8732489cb2fbe83e2aa1ac URL: https://github.com/kamailio/kamailio/commit/1c6fcd1bc43165cd9a8732489cb2fbe8...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-11-25T13:20:43+01:00
cnxcc: safety check before freeing call structure
- reported by GH#417
(cherry picked from commit ce5591e8f7568f98b39d9b96a2c8debe81837a07)
---
Modified: modules/cnxcc/cnxcc_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/1c6fcd1bc43165cd9a8732489cb2fbe8... Patch: https://github.com/kamailio/kamailio/commit/1c6fcd1bc43165cd9a8732489cb2fbe8...
---
diff --git a/modules/cnxcc/cnxcc_mod.c b/modules/cnxcc/cnxcc_mod.c index b8270ca..f24e8bd 100644 --- a/modules/cnxcc/cnxcc_mod.c +++ b/modules/cnxcc/cnxcc_mod.c @@ -906,6 +906,9 @@ void terminate_all_calls(credit_data_t *credit_data) { static void __free_call(call_t *call) { struct str_hash_entry *e = NULL;
+ if(call->sip_data.callid.s==NULL) + return; + LM_DBG("Freeing call [%.*s]\n", call->sip_data.callid.len, call->sip_data.callid.s); e = str_hash_get(_data.money.call_data_by_cid, call->sip_data.callid.s, call->sip_data.callid.len);