]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_conference] Fix memory leaks and a possible deadlock in chat_send();
authorAndrey Volk <andywolk@gmail.com>
Sun, 16 Feb 2020 19:22:29 +0000 (23:22 +0400)
committerAndrey Volk <andywolk@gmail.com>
Wed, 6 May 2020 22:40:41 +0000 (02:40 +0400)
src/mod/applications/mod_conference/conference_event.c

index 8a84fdd0495deed12bdb87fe777da3530af6f2ab..806dfc95ed24058c347a3fc6f77392fc5da8e571 100644 (file)
@@ -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;