Module: kamailio Branch: master Commit: 9d793bb6290d5ff857068f9554268f68b3f5e3ff URL: https://github.com/kamailio/kamailio/commit/9d793bb6290d5ff857068f9554268f68...
Author: jaybeepee jason.penton@gmail.com Committer: jaybeepee jason.penton@gmail.com Date: 2016-09-28T10:49:16+02:00
modules/cdp: cater for missing granted service unit in CCA - prevent segfault
---
Modified: modules/cdp/acctstatemachine.c
---
Diff: https://github.com/kamailio/kamailio/commit/9d793bb6290d5ff857068f9554268f68... Patch: https://github.com/kamailio/kamailio/commit/9d793bb6290d5ff857068f9554268f68...
---
diff --git a/modules/cdp/acctstatemachine.c b/modules/cdp/acctstatemachine.c index 777971d..29536fb 100644 --- a/modules/cdp/acctstatemachine.c +++ b/modules/cdp/acctstatemachine.c @@ -30,6 +30,7 @@ void update_gsu_response_timers(cdp_cc_acc_session_t* session, AAAMessage* msg) AAA_AVP_LIST y; AAA_AVP *z;
+ y.head = y.tail = 0; avp = AAAFindMatchingAVP(msg, 0, AVP_Multiple_Services_Credit_Control, 0, 0); if (!avp) { LM_WARN("Trying to update GSU timers but there is no MSCC AVP in the CCA response\n"); @@ -76,8 +77,11 @@ void update_gsu_response_timers(cdp_cc_acc_session_t* session, AAAMessage* msg) mscc_avp = mscc_avp->next; }
- AAAFreeAVPList(&mscc_avp_list); - AAAFreeAVPList(&y); + if (mscc_avp_list.head); + AAAFreeAVPList(&mscc_avp_list); + + if (y.head) + AAAFreeAVPList(&y); }