Skip to content

Commit

Permalink
ims_charging: free local structure in case of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Dec 7, 2023
1 parent 8794e50 commit 890dc5f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/ims_charging/ims_ro.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 890dc5f

Please sign in to comment.