[asterisk-commits] russell: branch 1.4 r223485 - /branches/1.4/main/autoservice.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 11 12:22:54 CDT 2009


Author: russell
Date: Sun Oct 11 12:22:52 2009
New Revision: 223485

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=223485
Log:
Don't use data outside of its scope.

The purpose of this code was to have a hangup frame put on the list of deferred
frames.  However, the code that read the hangup frame was outside of the scope
of where the hangup frame was declared.

Modified:
    branches/1.4/main/autoservice.c

Modified: branches/1.4/main/autoservice.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/autoservice.c?view=diff&rev=223485&r1=223484&r2=223485
==============================================================================
--- branches/1.4/main/autoservice.c (original)
+++ branches/1.4/main/autoservice.c Sun Oct 11 12:22:52 2009
@@ -77,6 +77,11 @@
 
 static void *autoservice_run(void *ign)
 {
+	struct ast_frame hangup_frame = {
+		.frametype = AST_FRAME_CONTROL,
+		.subclass = AST_CONTROL_HANGUP,
+	};
+
 	for (;;) {
 		struct ast_channel *mons[MAX_AUTOMONS];
 		struct asent *ents[MAX_AUTOMONS];
@@ -121,7 +126,6 @@
 		f = ast_read(chan);
 	
 		if (!f) {
-			struct ast_frame hangup_frame = { 0, };
 			/* No frame means the channel has been hung up.
 			 * A hangup frame needs to be queued here as ast_waitfor() may
 			 * never return again for the condition to be detected outside




More information about the asterisk-commits mailing list