mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-07 18:38:02 +00:00
handle a memory allocation failure immediately so the following large block
does not have to be indented git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3995,13 +3995,11 @@ static void build_mapping(char *name, char *value)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!map) {
|
if (!map) {
|
||||||
map = ast_calloc(1, sizeof(*map));
|
if (!(map = ast_calloc(1, sizeof(*map))))
|
||||||
if (map) {
|
return;
|
||||||
AST_LIST_INSERT_HEAD(&mappings, map, list);
|
AST_LIST_INSERT_HEAD(&mappings, map, list);
|
||||||
map->dead = 1;
|
map->dead = 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (map) {
|
|
||||||
map->options = 0;
|
map->options = 0;
|
||||||
memset(fields, 0, sizeof(fields));
|
memset(fields, 0, sizeof(fields));
|
||||||
x = 0;
|
x = 0;
|
||||||
@@ -4046,7 +4044,6 @@ static void build_mapping(char *name, char *value)
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ast_log(LOG_WARNING, "Expected at least %d arguments in map, but got only %d\n", 4, x);
|
ast_log(LOG_WARNING, "Expected at least %d arguments in map, but got only %d\n", 4, x);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user