]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
declinatio mortuus obfirmo
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 6 Mar 2013 19:59:02 +0000 (13:59 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 6 Mar 2013 19:59:02 +0000 (13:59 -0600)
src/mod/endpoints/mod_sofia/sofia_glue.c

index 78ba3c2132e3f9037c23f864d1f515ee644c60e5..5c40dc10bef8223520f9b161c5e68a25145d3b39 100644 (file)
@@ -6467,7 +6467,8 @@ void sofia_glue_actually_execute_sql_trans(sofia_profile_t *profile, char *sql,
 
        if (!(dbh = sofia_glue_get_db_handle(profile))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB\n");
-               return;
+
+               goto end;
        }
 
        switch_cache_db_persistant_execute_trans_full(dbh, sql, 1,
@@ -6479,6 +6480,8 @@ void sofia_glue_actually_execute_sql_trans(sofia_profile_t *profile, char *sql,
 
        switch_cache_db_release_db_handle(&dbh);
 
+ end:
+
        if (mutex) {
                switch_mutex_unlock(mutex);
        }
@@ -6495,6 +6498,11 @@ void sofia_glue_actually_execute_sql(sofia_profile_t *profile, char *sql, switch
 
        if (!(dbh = sofia_glue_get_db_handle(profile))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB\n");
+
+               if (mutex) {
+                       switch_mutex_unlock(mutex);
+               }
+
                return;
        }
 
@@ -6525,6 +6533,11 @@ switch_bool_t sofia_glue_execute_sql_callback(sofia_profile_t *profile,
 
        if (!(dbh = sofia_glue_get_db_handle(profile))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB\n");
+
+               if (mutex) {
+                       switch_mutex_unlock(mutex);
+               }
+
                return ret;
        }
 
@@ -6559,6 +6572,11 @@ char *sofia_glue_execute_sql2str(sofia_profile_t *profile, switch_mutex_t *mutex
 
        if (!(dbh = sofia_glue_get_db_handle(profile))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB\n");
+
+               if (mutex) {
+                       switch_mutex_unlock(mutex);
+               }
+               
                return NULL;
        }