]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_calendar: Protect channel when adding datastore.
authorJoshua Colp <jcolp@digium.com>
Wed, 18 Dec 2013 11:58:44 +0000 (11:58 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 18 Dec 2013 11:58:44 +0000 (11:58 +0000)
This change adds a missing channel lock when adding a datastore
to a channel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404135 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_calendar.c

index 7c8518b85ace6ab854e1237b34f92509c2a11e1f..6e509d73473db6a41aec1d275a142dcae85763e6 100644 (file)
@@ -725,7 +725,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 (!(apptext = ast_str_create(32))) {
                goto notify_cleanup;