From f2514644e1b9964bc4a2f91b8cbe6f8aedf1214b Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 27 Aug 2015 15:19:57 -0400 Subject: [PATCH] FS-7911: [mod_conference] do not allocate for conference cdr if conference cdr is disabled, and fix leak in conference_record --- src/mod/applications/mod_conference/conference_cdr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mod/applications/mod_conference/conference_cdr.c b/src/mod/applications/mod_conference/conference_cdr.c index fee5308af6..83ba8ee579 100644 --- a/src/mod/applications/mod_conference/conference_cdr.c +++ b/src/mod/applications/mod_conference/conference_cdr.c @@ -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;