]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
oups that wasnt on a pool
authorMathieu Rene <mrene@avgs.ca>
Sat, 11 Apr 2009 23:21:17 +0000 (23:21 +0000)
committerMathieu Rene <mrene@avgs.ca>
Sat, 11 Apr 2009 23:21:17 +0000 (23:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13006 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_menu.c

index 50e1a09d79b270502799b400f9a0477940cecfee..ba2c9746d7fc9039ec6f63803fbaf1a500d8ed8f 100644 (file)
@@ -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;