From: Italo Rossi Date: Sun, 31 Jan 2016 01:35:32 +0000 (-0300) Subject: FS-8768 - [mod_callcenter] Releasing db handle after reserving agent X-Git-Tag: v1.6.7~2^2~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe5fd7667a8bf5745bf6809f0aea708991432d4f;p=thirdparty%2Ffreeswitch.git FS-8768 - [mod_callcenter] Releasing db handle after reserving agent --- diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 2b0e28a5e7..0b9e319902 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -560,12 +560,15 @@ cc_queue_t *queue_set_config(cc_queue_t *queue) static int cc_execute_sql_affected_rows(char *sql) { switch_cache_db_handle_t *dbh = NULL; + int res = 0; if (!(dbh = cc_get_db_handle())) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB\n"); return -1; } switch_cache_db_execute_sql(dbh, sql, NULL); - return switch_cache_db_affected_rows(dbh); + res = switch_cache_db_affected_rows(dbh); + switch_cache_db_release_db_handle(&dbh); + return res; } char *cc_execute_sql2str(cc_queue_t *queue, switch_mutex_t *mutex, char *sql, char *resbuf, size_t len)