diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2013-08-06 08:43:22 +0000 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2013-08-06 08:43:22 +0000 |
commit | 07d3705b42a157423ba11fca5e5b57ea1bf303c6 (patch) | |
tree | c80cc5329c5cbff5f5c3f8ffcb4c4e4a76bb2d8b /funcs/func_strings.c | |
parent | ccdfe67bf2f1c9ea00b522a4e59d7e245b7fb7df (diff) |
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
Diffstat (limited to 'funcs/func_strings.c')
-rw-r--r-- | funcs/func_strings.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 20c85e63c..48fdaa8f6 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -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]) { |