[asterisk-commits] trunk r26625 - /trunk/pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 10 13:44:28 MST 2006


Author: rizzo
Date: Wed May 10 15:44:28 2006
New Revision: 26625

URL: http://svn.digium.com/view/asterisk?rev=26625&view=rev
Log:
lock conlock before accessing the list.


Modified:
    trunk/pbx.c

Modified: trunk/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx.c?rev=26625&r1=26624&r2=26625&view=diff
==============================================================================
--- trunk/pbx.c (original)
+++ trunk/pbx.c Wed May 10 15:44:28 2006
@@ -3422,12 +3422,11 @@
 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) {
+		ast_mutex_lock(&conlock);
 		local_contexts = &contexts;
-		ast_mutex_lock(&conlock);
 	} else
 		local_contexts = extcontexts;
 



More information about the asterisk-commits mailing list