mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
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 ........ Merged revisions 396287 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -607,14 +607,18 @@ static int dundi_lookup_local(struct dundi_result *dr, struct dundi_mapping *map
|
||||
ast_eid_to_str(dr[anscnt].eid_str, sizeof(dr[anscnt].eid_str), &dr[anscnt].eid);
|
||||
if (ast_test_flag(&flags, DUNDI_FLAG_EXISTS)) {
|
||||
AST_LIST_HEAD_INIT_NOLOCK(&headp);
|
||||
newvariable = ast_var_assign("NUMBER", called_number);
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
newvariable = ast_var_assign("EID", dr[anscnt].eid_str);
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
newvariable = ast_var_assign("SECRET", cursecret);
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
newvariable = ast_var_assign("IPADDR", ipaddr);
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
if ((newvariable = ast_var_assign("NUMBER", called_number))) {
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
}
|
||||
if ((newvariable = ast_var_assign("EID", dr[anscnt].eid_str))) {
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
}
|
||||
if ((newvariable = ast_var_assign("SECRET", cursecret))) {
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
}
|
||||
if ((newvariable = ast_var_assign("IPADDR", ipaddr))) {
|
||||
AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
|
||||
}
|
||||
pbx_substitute_variables_varshead(&headp, map->dest, dr[anscnt].dest, sizeof(dr[anscnt].dest));
|
||||
dr[anscnt].weight = get_mapping_weight(map, &headp);
|
||||
while ((newvariable = AST_LIST_REMOVE_HEAD(&headp, entries)))
|
||||
|
Reference in New Issue
Block a user