[asterisk-commits] wdoekes: branch 11 r396310 - /branches/11/funcs/func_strings.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 6 03:37:39 CDT 2013


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




More information about the asterisk-commits mailing list