summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/res_calendar_icalendar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c
index dc7b5f31c..3aea7a463 100644
--- a/res/res_calendar_icalendar.c
+++ b/res/res_calendar_icalendar.c
@@ -468,6 +468,11 @@ static void *ical_load_calendar(void *void_data)
ast_debug(10, "Refreshing after %d minute timeout\n", pvt->owner->refresh);
+ /* Free the old calendar data */
+ if (pvt->data) {
+ icalcomponent_free(pvt->data);
+ pvt->data = NULL;
+ }
if (!(pvt->data = fetch_icalendar(pvt))) {
ast_log(LOG_WARNING, "Unable to parse iCalendar '%s'\n", pvt->owner->name);
continue;