summaryrefslogtreecommitdiff
path: root/res/res_calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_calendar.c')
-rw-r--r--res/res_calendar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_calendar.c b/res/res_calendar.c
index 92b73c1ed..666b0e184 100644
--- a/res/res_calendar.c
+++ b/res/res_calendar.c
@@ -1888,7 +1888,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)) {
@@ -1902,7 +1902,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) {