[asterisk-commits] mmichelson: trunk r243487 - in /trunk: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 27 12:08:05 CST 2010


Author: mmichelson
Date: Wed Jan 27 12:08:02 2010
New Revision: 243487

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=243487
Log:
Merged revisions 243486 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243486 | mmichelson | 2010-01-27 12:06:43 -0600 (Wed, 27 Jan 2010) | 3 lines
  
  Use a safe list traversal while checking for duplicate vars in pbx_builtin_setvar_helper.
........

Modified:
    trunk/   (props changed)
    trunk/main/pbx.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=243487&r1=243486&r2=243487
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Jan 27 12:08:02 2010
@@ -9434,14 +9434,15 @@
 			nametail++;
 	}
 
-	AST_LIST_TRAVERSE (headp, newvariable, entries) {
+	AST_LIST_TRAVERSE_SAFE_BEGIN(headp, newvariable, entries) {
 		if (strcasecmp(ast_var_name(newvariable), nametail) == 0) {
 			/* there is already such a variable, delete it */
-			AST_LIST_REMOVE(headp, newvariable, entries);
+			AST_LIST_REMOVE_CURRENT(entries);
 			ast_var_delete(newvariable);
 			break;
 		}
 	}
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	if (value) {
 		if (headp == &globals)




More information about the asterisk-commits mailing list