mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
Avoid deadlock, don't leak on duplicate gateway name, error on duplicate gateway name
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8023 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -2285,7 +2285,8 @@ sofia_profile_t *sofia_glue_find_profile__(const char *file, const char *func, i
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if ((profile = (sofia_profile_t *) switch_core_hash_find(mod_sofia_globals.profile_hash, key))) {
|
||||
if (!(profile->pflags & PFLAG_RUNNING)) {
|
||||
return NULL;
|
||||
profile = NULL;
|
||||
goto done;
|
||||
}
|
||||
if (switch_thread_rwlock_tryrdlock(profile->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
#ifdef SOFIA_DEBUG_RWLOCKS
|
||||
@@ -2303,6 +2304,8 @@ sofia_profile_t *sofia_glue_find_profile__(const char *file, const char *func, i
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_ERROR, "XXXXXXXXXXXXXX LOCK %s\n", profile->name);
|
||||
}
|
||||
#endif
|
||||
|
||||
done:
|
||||
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
|
||||
|
||||
return profile;
|
||||
|
||||
Reference in New Issue
Block a user