提交 686efff6 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix seg on bug removal

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16870 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 26eb2ea8
......@@ -461,16 +461,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session
}
switch_thread_rwlock_unlock(session->bug_rwlock);
if (bp) {
switch_event_t *event;
switch_event_t *event = NULL;
if ((status = switch_core_media_bug_close(&bp)) == SWITCH_STATUS_SUCCESS) {
if (switch_event_create(&event, SWITCH_EVENT_MEDIA_BUG_STOP) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Media-Bug-Function", "%s", bp->function);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Media-Bug-Target", "%s", bp->target);
switch_event_fire(&event);
}
if (switch_event_create(&event, SWITCH_EVENT_MEDIA_BUG_STOP) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Media-Bug-Function", "%s", bp->function);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Media-Bug-Target", "%s", bp->target);
}
if ((status = switch_core_media_bug_close(&bp)) == SWITCH_STATUS_SUCCESS) {
switch_event_fire(&event);
} else {
switch_event_destroy(&event);
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论