]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11785 [mod_conference] fix memory leak on realloc failure
authorChris Rienzo <chris@signalwire.com>
Tue, 16 Apr 2019 13:57:56 +0000 (13:57 +0000)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 16:22:27 +0000 (20:22 +0400)
                          fix dead assignments in conference_cdr

src/mod/applications/mod_conference/conference_api.c
src/mod/applications/mod_conference/conference_cdr.c

index ab0fc7b7ecf51423dcd8d4d9f9c675b1d20e4f26..d4e5fb8ad9df315c3e7f3b15bbf2dae91bb24f5e 100644 (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;
                }
        }
index ba01a1e6eb979845eebcf8d397fa47f2e3d26cf0..b6eb630540e3e39d7f4982bdcf67aa7d1411d079 100644 (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",