提交 1a71cf88 authored 作者: Travis Cross's avatar Travis Cross

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.
上级 a0b8d922
......@@ -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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论