Merge "res_config_pgsql: Release table locks where appropriate" into 14

This commit is contained in:
Joshua Colp
2017-03-01 04:47:24 -06:00
committed by Gerrit Code Review

View File

@@ -735,6 +735,7 @@ static int update_pgsql(const char *database, const char *tablename, const char
ast_mutex_lock(&pgsql_lock);
if (!pgsql_reconnect(database)) {
ast_mutex_unlock(&pgsql_lock);
release_table(table);
return -1;
}
@@ -880,6 +881,7 @@ static int update2_pgsql(const char *database, const char *tablename, const stru
ast_mutex_lock(&pgsql_lock);
if (!pgsql_reconnect(database)) {
ast_mutex_unlock(&pgsql_lock);
release_table(table);
return -1;
}
@@ -1324,6 +1326,7 @@ static int require_pgsql(const char *database, const char *tablename, va_list ap
if (pgsql_exec(database, tablename, ast_str_buffer(sql), &result) != 0) {
ast_mutex_unlock(&pgsql_lock);
release_table(table);
return -1;
}