diff --git a/res/res_calendar.c b/res/res_calendar.c index b60d8234d9501754d17a8bfcfc32a8ea7c760063..0ec032cf99e31a405131537a935e4e61d0412e3b 100644 --- a/res/res_calendar.c +++ b/res/res_calendar.c @@ -766,7 +766,10 @@ static void *do_notify(void *data) datastore->inheritance = DATASTORE_INHERIT_FOREVER; ao2_ref(event, +1); + + ast_channel_lock(chan); res = ast_channel_datastore_add(chan, datastore); + ast_channel_unlock(chan); if (!(tmpstr = ast_str_create(32))) { goto notify_cleanup;