diff options
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/main/pbx.c b/main/pbx.c index 9ef2f1ed0..4c95b278f 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -10911,10 +10911,9 @@ void pbx_builtin_pushvar_helper(struct ast_channel *chan, const char *name, cons headp = &globals; } - if (value) { + if (value && (newvariable = ast_var_assign(name, value))) { if (headp == &globals) ast_verb(2, "Setting global variable '%s' to '%s'\n", name, value); - newvariable = ast_var_assign(name, value); AST_LIST_INSERT_HEAD(headp, newvariable, entries); } @@ -10961,10 +10960,9 @@ int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const } AST_LIST_TRAVERSE_SAFE_END; - if (value) { + if (value && (newvariable = ast_var_assign(name, value))) { if (headp == &globals) ast_verb(2, "Setting global variable '%s' to '%s'\n", name, value); - newvariable = ast_var_assign(name, value); AST_LIST_INSERT_HEAD(headp, newvariable, entries); ast_channel_publish_varset(chan, name, value); |