FS-11785 [mod_conference] fix memory leak on realloc failure

fix dead assignments in conference_cdr
This commit is contained in:
Chris Rienzo 2019-04-16 13:57:56 +00:00 committed by Andrey Volk
parent c6990e7a74
commit 464490ead5
2 changed files with 1 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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",