diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-10 20:44:28 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-10 20:44:28 +0000 |
commit | 5bd154a13c6358cfd4fff4eb99aa97119a85132a (patch) | |
tree | 28a6514e8b004b53c3161d1b5678281803195bb0 /pbx.c | |
parent | 17c63393f04268758837433cea4e5a557d3211c9 (diff) |
lock conlock before accessing the list.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26625 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rw-r--r-- | pbx.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -3422,12 +3422,11 @@ int ast_unregister_application(const char *app) struct ast_context *ast_context_create(struct ast_context **extcontexts, const char *name, const char *registrar) { struct ast_context *tmp, **local_contexts; - int length; - length = sizeof(struct ast_context); - length += strlen(name) + 1; + int length = sizeof(struct ast_context) + strlen(name) + 1; + if (!extcontexts) { - local_contexts = &contexts; ast_mutex_lock(&conlock); + local_contexts = &contexts; } else local_contexts = extcontexts; |