summaryrefslogtreecommitdiff
path: root/funcs
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-08-28 18:41:18 +0000
committerRussell Bryant <russell@russellbryant.com>2007-08-28 18:41:18 +0000
commit2f4a2811b6f7033983cbd00c6f5cb4d4585e3146 (patch)
tree47fb475a7e6ae8f70f0cfdd703461483f0b1e926 /funcs
parent040a5f20f9fd04805dcb8b5dd5cc6028d11fa617 (diff)
Add proper channel locking around the uses of datastore_add and _find. There
are still more places in the tree that I have not yet changed if someone wants to go through and find the places they are used without the channel locked. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_enum.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/funcs/func_enum.c b/funcs/func_enum.c
index f3655be9e..677698cfe 100644
--- a/funcs/func_enum.c
+++ b/funcs/func_enum.c
@@ -201,7 +201,9 @@ static int enum_query_read(struct ast_channel *chan, const char *cmd, char *data
datastore->data = erds;
+ ast_channel_lock(chan);
ast_channel_datastore_add(chan, datastore);
+ ast_channel_unlock(chan);
res = 0;
@@ -246,7 +248,10 @@ static int enum_result_read(struct ast_channel *chan, const char *cmd, char *dat
goto finish;
}
- if (!(datastore = ast_channel_datastore_find(chan, &enum_result_datastore_info, args.id))) {
+ ast_channel_lock(chan);
+ datastore = ast_channel_datastore_find(chan, &enum_result_datastore_info, args.id);
+ ast_channel_unlock(chan);
+ if (!datastore) {
ast_log(LOG_WARNING, "No ENUM results found for query id!\n");
goto finish;
}