Fix memory leak in phrase macro playback

We were leaking memory when break_on_match was set or when we received
back SWITCH_STATUS_BREAK from a callee as we were failing to free
field_expanded_alloc.
This commit is contained in:
Travis Cross 2014-04-09 07:26:36 +00:00
parent bd2b63da27
commit 90930d2958

View File

@ -318,13 +318,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
} }
switch_regex_safe_free(re); switch_regex_safe_free(re);
switch_safe_free(field_expanded_alloc);
if ((match && do_break && switch_true(do_break)) || status == SWITCH_STATUS_BREAK) { if ((match && do_break && switch_true(do_break)) || status == SWITCH_STATUS_BREAK) {
break; break;
} }
switch_safe_free(field_expanded_alloc);
if (status != SWITCH_STATUS_SUCCESS) { if (status != SWITCH_STATUS_SUCCESS) {
done = 1; done = 1;
break; break;