Browse code

usrloc: handle return code when registering the timer routine

(cherry picked from commit 9a152cbd15a84191418ecd3bbb56dff48438bfd1)

Daniel-Constantin Mierla authored on 05/11/2016 12:32:05
Showing 1 changed files
... ...
@@ -366,7 +366,10 @@ static int mod_init(void)
366 366
 	}
367 367
 	if(db_mode==WRITE_THROUGH || db_mode==WRITE_BACK) {
368 368
 		if(ul_db_timer_clean!=0) {
369
-			sr_wtimer_add(ul_db_clean_timer, 0, timer_interval);
369
+			if(sr_wtimer_add(ul_db_clean_timer, 0, timer_interval)<0) {
370
+				LM_ERR("failed to add db clean timer routine\n");
371
+				return -1;
372
+			}
370 373
 		}
371 374
 	}
372 375