FS-7911: [mod_conference] do not allocate for conference cdr if conference cdr is disabled, and fix leak in conference_record

This commit is contained in:
Michael Jerris 2015-08-27 15:19:57 -04:00
parent d36c9fdd56
commit f2514644e1
1 changed files with 6 additions and 0 deletions

View File

@ -488,6 +488,8 @@ cJSON *conference_cdr_json_render(conference_obj_t *conference, cJSON *req)
void conference_cdr_del(conference_member_t *member)
{
if (!member->cdr_node) return;
if (member->channel) {
switch_channel_get_variables(member->channel, &member->cdr_node->var_event);
}
@ -504,6 +506,8 @@ void conference_cdr_add(conference_member_t *member)
switch_caller_profile_t *cp;
switch_channel_t *channel;
if (zstr(member->conference->log_dir) && (member->conference->cdr_event_mode == CDRE_NONE)) return;
np = switch_core_alloc(member->conference->pool, sizeof(*np));
np->next = member->conference->cdr_nodes;
@ -535,6 +539,8 @@ void conference_cdr_rejected(conference_obj_t *conference, switch_channel_t *cha
conference_cdr_reject_t *rp;
switch_caller_profile_t *cp;
if (zstr(conference->log_dir) && (conference->cdr_event_mode == CDRE_NONE)) return;
rp = switch_core_alloc(conference->pool, sizeof(*rp));
rp->next = conference->cdr_rejected;