]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix database handles infinitely locked in switch_cache_db_database_interface_f...
authorAndrey Volk <andywolk@gmail.com>
Sat, 17 Apr 2021 23:09:57 +0000 (02:09 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:44 +0000 (22:00 +0300)
src/switch_core_sqldb.c

index 061a5ed15ef95252275178357e6a2455155ad332..0f6ecd584178686b7069e9cd68d331f7aa63b157 100644 (file)
@@ -156,10 +156,12 @@ top:
        for (dbh_ptr = sql_manager.handle_pool; dbh_ptr; dbh_ptr = dbh_ptr->next) {
                if (switch_mutex_trylock(dbh_ptr->mutex) == SWITCH_STATUS_SUCCESS) {
                        if (dbh_ptr->type != SCDB_TYPE_DATABASE_INTERFACE) {
+                               switch_mutex_unlock(dbh_ptr->mutex);
                                continue;
                        }
 
                        if (dbh_ptr->native_handle.database_interface_dbh->connection_options.database_interface != database_interface) {
+                               switch_mutex_unlock(dbh_ptr->mutex);
                                continue;
                        }