diff options
Diffstat (limited to 'res/res_calendar.c')
-rw-r--r-- | res/res_calendar.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_calendar.c b/res/res_calendar.c index 6f6f711b3..d0f48fb02 100644 --- a/res/res_calendar.c +++ b/res/res_calendar.c @@ -1882,7 +1882,7 @@ static int load_module(void) { if (!(calendars = ao2_container_alloc(CALENDAR_BUCKETS, calendar_hash_fn, calendar_cmp_fn))) { ast_log(LOG_ERROR, "Unable to allocate calendars container!\n"); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } if (load_config(0)) { @@ -1896,7 +1896,9 @@ static int load_module(void) if (!(sched = ast_sched_context_create())) { ast_log(LOG_ERROR, "Unable to create sched context\n"); - return AST_MODULE_LOAD_FAILURE; + ast_config_destroy(calendar_config); + calendar_config = NULL; + return AST_MODULE_LOAD_DECLINE; } if (ast_pthread_create_background(&refresh_thread, NULL, do_refresh, NULL) < 0) { |