Skip to content

Commit

Permalink
fraud_detection: Fix shm memory leak
Browse files Browse the repository at this point in the history
(cherry picked from commit 4a0d22d)
  • Loading branch information
liviuchircu committed Oct 19, 2016
1 parent 09239e7 commit f6bebb8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/fraud_detection/fraud_detection.c
Expand Up @@ -438,10 +438,8 @@ static int check_fraud(struct sip_msg *msg, char *_user, char *_number, char *_p
param->ruleid = rule->id;
param->data_rev = frd_data_rev;

/* Register the dlg_terminate cb */
if (shm_str_dup(&param->number, &number) != 0)
shm_free(param);
else if (dlgb.register_dlgcb(dlgc, DLGCB_TERMINATED,
/* Register dialog termination hooks */
if (dlgb.register_dlgcb(dlgc, DLGCB_TERMINATED,
dialog_terminate_CB, param, NULL) != 0) {
LM_ERR("cannot register dialog callback\n");
shm_free(param->number.s);
Expand Down

0 comments on commit f6bebb8

Please sign in to comment.