From 1a71cf886ebb2cbb175a82283b5bf8ffe0cabdc1 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 9 Apr 2014 07:14:59 +0000 Subject: [PATCH] Fix memory leak on memory error In the event of a memory error, we were trying to free a null pointer while leaking the allocation for field_expanded_alloc. --- src/switch_ivr_play_say.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 14d3703338..813a109aac 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -227,7 +227,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio if (!(substituted = malloc(len))) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Memory Error!\n"); switch_regex_safe_free(re); - switch_safe_free(expanded); + switch_safe_free(field_expanded_alloc); goto done; } memset(substituted, 0, len);