diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-27 18:08:02 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-27 18:08:02 +0000 |
commit | 182dc0d6c4e61c3edbfd836c7a03e17956f9fb9b (patch) | |
tree | f97d1019998696054db5aa4d663ace67155f8d51 /main/pbx.c | |
parent | af83c7e76dabd3567053b08ab51ebfd1ccdad33b (diff) |
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.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243487 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index c13feffb7..3b3b1cd6d 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -9434,14 +9434,15 @@ int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const 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) |