Author: wdoekes
Date: Tue Aug  6 03:37:37 2013
New Revision: 396310

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396310
Log:
Check result of ast_var_assign() calls for memory allocation failure (2).

Missed a spot in the previous commit.

Modified:
    branches/11/funcs/func_strings.c

Modified: branches/11/funcs/func_strings.c
URL: 
http://svnview.digium.com/svn/asterisk/branches/11/funcs/func_strings.c?view=diff&rev=396310&r1=396309&r2=396310
==============================================================================
--- branches/11/funcs/func_strings.c (original)
+++ branches/11/funcs/func_strings.c Tue Aug  6 03:37:37 2013
@@ -1806,6 +1806,13 @@
                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]) {


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to