aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_enum.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-28 18:41:18 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-28 18:41:18 +0000
commit2a92caf3221235c0977b4f395c489d258d33995b (patch)
tree47fb475a7e6ae8f70f0cfdd703461483f0b1e926 /funcs/func_enum.c
parentac52aa8cd647b169554fb09012f69be9b6bd249d (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: http://svn.digium.com/svn/asterisk/trunk@81262 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_enum.c')
-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;
}