Author: wdoekes
Date: Tue Aug  6 03:43:22 2013
New Revision: 396311

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396311
Log:
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

Modified:
    trunk/   (props changed)
    trunk/funcs/func_strings.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/funcs/func_strings.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/funcs/func_strings.c?view=diff&rev=396311&r1=396310&r2=396311
==============================================================================
--- trunk/funcs/func_strings.c (original)
+++ trunk/funcs/func_strings.c Tue Aug  6 03:43:22 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