Ver código fonte

usrloc: handle return code when registering the timer routine

Daniel-Constantin Mierla 8 anos atrás
pai
commit
9a152cbd15
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      modules/usrloc/ul_mod.c

+ 4 - 1
modules/usrloc/ul_mod.c

@@ -358,7 +358,10 @@ static int mod_init(void)
 	}
 	if(db_mode==WRITE_THROUGH || db_mode==WRITE_BACK) {
 		if(ul_db_timer_clean!=0) {
-			sr_wtimer_add(ul_db_clean_timer, 0, timer_interval);
+			if(sr_wtimer_add(ul_db_clean_timer, 0, timer_interval)<0) {
+				LM_ERR("failed to add db clean timer routine\n");
+				return -1;
+			}
 		}
 	}