[Freeswitch-svn] [commit] r8462 - freeswitch/trunk/src/mod/applications/mod_fifo

Freeswitch SVN anthm at freeswitch.org
Mon May 19 12:26:50 EDT 2008


Author: anthm
Date: Mon May 19 12:26:50 2008
New Revision: 8462

Modified:
   freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c

Log:
fix possible memory overload during error condition

Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	Mon May 19 12:26:50 2008
@@ -569,7 +569,11 @@
 			switch_core_session_flush_private_events(session);
 
 			if (moh) {
-				switch_ivr_play_file(session, NULL, moh, &args);
+				switch_status_t status = switch_ivr_play_file(session, NULL, moh, &args);
+				if (!SWITCH_READ_ACCEPTABLE(status)) {
+					aborted = 1;
+					goto abort;
+				}
 			} else {
 				switch_ivr_collect_digits_callback(session, &args, 0);
 			}
@@ -736,10 +740,15 @@
 			pop = NULL;
 			
             if (moh && do_wait) {
+				switch_status_t status = switch_ivr_play_file(session, NULL, moh, &args);
 				memset(&args, 0, sizeof(args));
                 args.read_frame_callback = consumer_read_frame_callback;
                 args.user_data = node_list;
                 switch_ivr_play_file(session, NULL, moh, &args);
+				
+				if (!SWITCH_READ_ACCEPTABLE(status)) {
+					break;
+				}
             }
 			
 			for(i = 0; i < node_count; i++) {



More information about the Freeswitch-svn mailing list