]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
lock conlock before accessing the list.
authorLuigi Rizzo <rizzo@icir.org>
Wed, 10 May 2006 20:44:28 +0000 (20:44 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Wed, 10 May 2006 20:44:28 +0000 (20:44 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26625 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index c1254ae6029bf36ac37b33495b38428d0736c464..1238a7cd370ef94d79571723652fdec43f07cf8d 100644 (file)
--- a/pbx.c
+++ b/pbx.c
@@ -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;