From 464490ead5196f9b9a4a7a20cd564cfe1b09ae3b Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Tue, 16 Apr 2019 13:57:56 +0000 Subject: [PATCH] FS-11785 [mod_conference] fix memory leak on realloc failure fix dead assignments in conference_cdr --- src/mod/applications/mod_conference/conference_api.c | 1 + src/mod/applications/mod_conference/conference_cdr.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index ab0fc7b7ec..d4e5fb8ad9 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -300,6 +300,7 @@ switch_status_t conference_api_sub_syntax(char **syntax) } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't realloc\n"); + switch_safe_free(p); return SWITCH_STATUS_TERM; } } diff --git a/src/mod/applications/mod_conference/conference_cdr.c b/src/mod/applications/mod_conference/conference_cdr.c index ba01a1e6eb..b6eb630540 100644 --- a/src/mod/applications/mod_conference/conference_cdr.c +++ b/src/mod/applications/mod_conference/conference_cdr.c @@ -315,8 +315,6 @@ char *conference_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t switch_mutex_unlock(conference->member_mutex); - off1 = off2 = off3 = off4 = 0; - xml_text = switch_xml_toxml(xml, SWITCH_TRUE); switch_xml_free(xml); @@ -741,7 +739,6 @@ void conference_cdr_render(conference_obj_t *conference) wrote = write(fd, xml_text, (unsigned) strlen(xml_text)); wrote++; close(fd); - fd = -1; } else { char ebuf[512] = { 0 }; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n", -- 2.47.2