aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index cae71d5e9..cb0c9f287 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1372,9 +1372,11 @@ void ast_channel_free(struct ast_channel *chan)
}
/* Get rid of each of the data stores on the channel */
+ ast_channel_lock(chan);
while ((datastore = AST_LIST_REMOVE_HEAD(&chan->datastores, entry)))
/* Free the data store */
ast_channel_datastore_free(datastore);
+ ast_channel_unlock(chan);
/* Lock and unlock the channel just to be sure nobody has it locked still
due to a reference that was stored in a datastore. (i.e. app_chanspy) */