]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_erlang_event] Fix segfault in destroy_listener()
authorVCC Live/Core <56296664+vcc-core@users.noreply.github.com>
Fri, 24 Apr 2020 20:49:07 +0000 (22:49 +0200)
committerAndrey Volk <andywolk@gmail.com>
Wed, 6 May 2020 23:14:18 +0000 (03:14 +0400)
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c

index f76708691d569e4a6052056f0297363e31458a37..d15f748eb78d7f77ad6dae0077d97592574a248f 100644 (file)
@@ -1401,7 +1401,6 @@ void destroy_listener(listener_t * listener)
        switch_mutex_unlock(listener->sock_mutex);
 
        switch_core_hash_destroy(&listener->event_hash);
-       switch_core_hash_destroy(&listener->sessions);
 
        /* remove any bindings for this connection */
        remove_binding(listener, NULL);
@@ -1414,6 +1413,7 @@ void destroy_listener(listener_t * listener)
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Orphaning call %s\n", s->uuid_str);
                destroy_session_elem(s);
        }
+       switch_core_hash_destroy(&listener->sessions);
        switch_thread_rwlock_unlock(listener->session_rwlock);
        switch_thread_rwlock_unlock(listener->rwlock);
 
@@ -1421,7 +1421,6 @@ void destroy_listener(listener_t * listener)
                switch_memory_pool_t *pool = listener->pool;
                switch_core_destroy_memory_pool(&pool);
        }
-
 }
 
 static switch_status_t state_handler(switch_core_session_t *session)