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 (2).
Missed a spot in the previous commit. ........ Merged revisions 396310 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1806,6 +1806,13 @@ AST_TEST_DEFINE(test_STRREPLACE)
|
||||
char tmp[512], tmp2[512] = "";
|
||||
|
||||
struct ast_var_t *var = ast_var_assign("test_string", test_strings[i][0]);
|
||||
if (!var) {
|
||||
ast_test_status_update(test, "Unable to allocate variable\n");
|
||||
ast_free(str);
|
||||
ast_channel_release(chan);
|
||||
return AST_TEST_FAIL;
|
||||
}
|
||||
|
||||
AST_LIST_INSERT_HEAD(ast_channel_varshead(chan), var, entries);
|
||||
|
||||
if (test_strings[i][3]) {
|
||||
|
Reference in New Issue
Block a user