Skip to content

Commit

Permalink
fraud_detection: Fix possible startup crash
Browse files Browse the repository at this point in the history
Race condition between drouting startup and check_fraud()

Credits to Jim DeVito for helping with troubleshooting

(cherry picked from commit 2efc77d)
  • Loading branch information
liviuchircu committed Nov 4, 2016
1 parent ef3b538 commit d410795
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/fraud_detection/fraud_detection.c
Expand Up @@ -273,10 +273,10 @@ static int check_fraud(struct sip_msg *msg, char *_user, char *_number, char *_p
static str last_called_prefix;
extern unsigned int frd_data_rev;

if (dr_head == NULL) {
if (*dr_head == NULL) {
/* No data, probably still loading */
LM_ERR("no data\n");
return rc_error;
LM_INFO("rules are not available yet!\n");
return rc_ok_thr;
}

/* Get the actual params */
Expand Down

0 comments on commit d410795

Please sign in to comment.