diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index e628cd267a8..55e40fb4905 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1834,11 +1834,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess sp_prev_idx += olen; if (cont) { + switch_safe_free(data); continue; } } else { sp_prev_idx = 0; - extra = 0; currp = bp; } @@ -1986,6 +1986,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess break; } } + if (sp_prev) { switch_safe_free(sp_prev); } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "done playing file %s\n", file); switch_channel_set_variable_printf(channel, "playback_last_offset_pos", "%d", fh->offset_pos);