From 928f6cda1eef87593c5809d0db5aad057742df93 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 19 May 2008 16:26:50 +0000 Subject: [PATCH] fix possible memory overload during error condition git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8462 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_fifo/mod_fifo.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 34238cd759..78676f0492 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -569,7 +569,11 @@ SWITCH_STANDARD_APP(fifo_function) 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 @@ SWITCH_STANDARD_APP(fifo_function) 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++) {