Module: kamailio
Branch: master
Commit: 890dc5f017084481cd2b0f0d759939393fa115bc
URL:
https://github.com/kamailio/kamailio/commit/890dc5f017084481cd2b0f0d7599393…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-07T08:21:22+01:00
ims_charging: free local structure in case of errors
---
Modified: src/modules/ims_charging/ims_ro.c
---
Diff:
https://github.com/kamailio/kamailio/commit/890dc5f017084481cd2b0f0d7599393…
Patch:
https://github.com/kamailio/kamailio/commit/890dc5f017084481cd2b0f0d7599393…
---
diff --git a/src/modules/ims_charging/ims_ro.c b/src/modules/ims_charging/ims_ro.c
index 6fe14ae3dd7..11c74169293 100644
--- a/src/modules/ims_charging/ims_ro.c
+++ b/src/modules/ims_charging/ims_ro.c
@@ -1721,6 +1721,7 @@ static void resume_on_initial_ccr(
}
Ro_free_CCA(ro_cca_data);
+ ro_cca_data = NULL;
LM_DBG("Freeing CCA message\n");
cdpb.AAAFreeMessage(&cca);
@@ -1757,9 +1758,11 @@ static void resume_on_initial_ccr(
return;
error1:
- Ro_free_CCA(ro_cca_data);
-
error0:
+ if(ro_cca_data != NULL) {
+ Ro_free_CCA(ro_cca_data);
+ }
+
LM_DBG("Trying to reserve credit on initial INVITE failed on cdp "
"callback\n");
// counter_add(ims_charging_cnts_h.active_ro_sessions, -1); /*we bumped active on the
original initial ccr sent */