瀏覽代碼

cnxcc: safety check before freeing call structure

- reported by GH#417
Daniel-Constantin Mierla 9 年之前
父節點
當前提交
ce5591e8f7
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      modules/cnxcc/cnxcc_mod.c

+ 3 - 0
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);