fix possible register memory leak

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8281 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-05-06 22:56:55 +00:00
parent b48ee12c1c
commit a41fa2e2bc
4 changed files with 16 additions and 4 deletions
+6 -1
View File
@@ -194,7 +194,7 @@ void sofia_event_callback(nua_event_t event,
switch_channel_t *channel = NULL;
sofia_gateway_t *gateway = NULL;
if (sofia_private) {
if (sofia_private && sofia_private != &mod_sofia_globals.destroy_private) {
if ((gateway = sofia_private->gateway)) {
if (switch_thread_rwlock_tryrdlock(gateway->profile->rwlock) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile %s is locked\n", gateway->profile->name);
@@ -356,6 +356,11 @@ void sofia_event_callback(nua_event_t event,
done:
if (sofia_private && sofia_private->destroy_nh) {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroy handle requested.\n");
nua_handle_destroy(nh);
}
if (gateway) {
sofia_reg_release_gateway(gateway);
}