From: Andrey Volk Date: Sun, 16 Feb 2020 19:22:29 +0000 (+0400) Subject: [mod_conference] Fix memory leaks and a possible deadlock in chat_send(); X-Git-Tag: v1.10.3^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a198e765feb12cd891c049c6684c86d9d3b1983e;p=thirdparty%2Ffreeswitch.git [mod_conference] Fix memory leaks and a possible deadlock in chat_send(); --- diff --git a/src/mod/applications/mod_conference/conference_event.c b/src/mod/applications/mod_conference/conference_event.c index 8a84fdd049..806dfc95ed 100644 --- a/src/mod/applications/mod_conference/conference_event.c +++ b/src/mod/applications/mod_conference/conference_event.c @@ -1029,17 +1029,18 @@ switch_status_t chat_send(switch_event_t *message_event) conference_list_pretty(conference, &stream); /* provide help */ } else { - return SWITCH_STATUS_SUCCESS; + goto done; } } - switch_safe_free(lbuf); - if (!conference->broadcast_chat_messages) { switch_core_chat_send_args(proto, CONF_CHAT_PROTO, to, hint && strchr(hint, '/') ? hint : from, "", stream.data, NULL, NULL, SWITCH_FALSE); } +done: + switch_safe_free(lbuf); switch_safe_free(stream.data); + switch_thread_rwlock_unlock(conference->rwlock); return SWITCH_STATUS_SUCCESS;