From: Travis Cross Date: Wed, 9 Apr 2014 07:26:36 +0000 (+0000) Subject: Fix memory leak in phrase macro playback X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90930d2958e7c353211422b48ba63c831b0d5c97;p=thirdparty%2Ffreeswitch.git 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. --- diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index db9c26d556..79ebd92479 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -318,13 +318,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio } switch_regex_safe_free(re); - + switch_safe_free(field_expanded_alloc); + if ((match && do_break && switch_true(do_break)) || status == SWITCH_STATUS_BREAK) { break; } - switch_safe_free(field_expanded_alloc); - if (status != SWITCH_STATUS_SUCCESS) { done = 1; break;