From 8e798960a74ae5fe551aee55a5543dd4a8c292d7 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sat, 11 Apr 2009 23:21:17 +0000 Subject: [PATCH] oups that wasnt on a pool git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13006 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_menu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/switch_ivr_menu.c b/src/switch_ivr_menu.c index 50e1a09d79..ba2c9746d7 100644 --- a/src/switch_ivr_menu.c +++ b/src/switch_ivr_menu.c @@ -291,13 +291,14 @@ static switch_status_t play_and_collect(switch_core_session_t *session, switch_i switch_status_t status = SWITCH_STATUS_FALSE; switch_input_args_t args = { 0 }; switch_channel_t *channel; + char *sound_expanded = sound; if (!session || !menu || switch_strlen_zero(sound)) { return status; } if ((channel = switch_core_session_get_channel(session))) { - sound = switch_channel_expand_variables(channel, sound); + sound_expanded = switch_channel_expand_variables(channel, sound); } memset(menu->buf, 0, menu->inlen + 1); @@ -313,7 +314,11 @@ static switch_status_t play_and_collect(switch_core_session_t *session, switch_i args.buf = ptr; args.buflen = len; - status = switch_ivr_play_file(session, NULL, sound, &args); + status = switch_ivr_play_file(session, NULL, sound_expanded, &args); + + if (sound_expanded != sound) { + switch_safe_free(sound_expanded); + } if (!need) { return status;