Check result of ast_var_assign() calls for memory allocation failure.

We try to keep the system running even when all available memory is
spent.

Review: https://reviewboard.asterisk.org/r/2734/
........

Merged revisions 396279 from http://svn.asterisk.org/svn/asterisk/branches/1.8


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@396287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Walter Doekes
2013-08-06 08:19:42 +00:00
parent 1e03a50878
commit 5c8ba4c4d6
9 changed files with 50 additions and 35 deletions

View File

@@ -245,8 +245,9 @@ static int frame_set_var(struct ast_channel *chan, struct gosub_stack_frame *fra
}
if (!found) {
variables = ast_var_assign(var, "");
AST_LIST_INSERT_HEAD(&frame->varshead, variables, entries);
if ((variables = ast_var_assign(var, ""))) {
AST_LIST_INSERT_HEAD(&frame->varshead, variables, entries);
}
pbx_builtin_pushvar_helper(chan, var, value);
} else {
pbx_builtin_setvar_helper(chan, var, value);