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:
Walter Doekes
2013-08-06 08:43:22 +00:00
parent ccdfe67bf2
commit 07d3705b42

View File

@@ -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]) {