[asterisk-commits] russell: branch 10 r359057 - in /branches/10: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 13 18:59:38 CDT 2012


Author: russell
Date: Tue Mar 13 18:59:35 2012
New Revision: 359057

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=359057
Log:
Don't use a buffer after it goes out of scope.

's' is set to 'workspace'.  Make sure 'workspace' doesn't go out of scope while
the reference to it via 's' is still used.
........

Merged revisions 359056 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/main/pbx.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/pbx.c?view=diff&rev=359057&r1=359056&r2=359057
==============================================================================
--- branches/10/main/pbx.c (original)
+++ branches/10/main/pbx.c Tue Mar 13 18:59:35 2012
@@ -3257,6 +3257,7 @@
 	int offset, length;
 	int i, need_substring;
 	struct varshead *places[2] = { headp, &globals };	/* list of places where we may look */
+	char workspace[20];
 
 	if (c) {
 		ast_channel_lock(c);
@@ -3352,7 +3353,6 @@
 		} else if (!strcmp(var, "ASTLOGDIR")) {
 			s = ast_config_AST_LOG_DIR;
 		} else if (!strcmp(var, "ENTITYID")) {
-			char workspace[20];
 			ast_eid_to_str(workspace, sizeof(workspace), &ast_eid_default);
 			s = workspace;
 		}




More information about the asterisk-commits mailing list