mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-14 07:14:14 +00:00
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.
This commit is contained in:
1 parent
a0b8d92219
commit
1a71cf886e
1 file changed
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user