提交 fc40e4ab authored 作者: Travis Cross's avatar Travis Cross

Avoid leaking data_buf in mod_conference

When we couldn't acquire the rwlock on the conference we were leaking
a buffer we just allocated.  On a 48k/10ms conference we would leak
960 bytes per attempt.
上级 64c678f1
......@@ -4515,15 +4515,14 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *th
int lead_in = 20;
switch_size_t len = 0;
data_buf_len = samples * sizeof(int16_t);
switch_zmalloc(data_buf, data_buf_len);
if (switch_thread_rwlock_tryrdlock(conference->rwlock) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Read Lock Fail\n");
return NULL;
}
data_buf_len = samples * sizeof(int16_t);
switch_zmalloc(data_buf, data_buf_len);
switch_mutex_lock(globals.hash_mutex);
globals.threads++;
switch_mutex_unlock(globals.hash_mutex);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论