浏览代码

usrloc: handle return code when registering the timer routine

Daniel-Constantin Mierla 8 年之前
父节点
当前提交
9a152cbd15
共有 1 个文件被更改,包括 4 次插入1 次删除
  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;
+			}
 		}
 	}