The find_table() functions NULL or a locked table pointer. We are
not consistently calling release_table() in failure paths.
Change-Id: I6f665b455799c84b036e5b34904b82b05eab9544
ast_mutex_lock(&pgsql_lock);
if (!pgsql_reconnect(database)) {
ast_mutex_unlock(&pgsql_lock);
+ release_table(table);
return -1;
}
ast_mutex_lock(&pgsql_lock);
if (!pgsql_reconnect(database)) {
ast_mutex_unlock(&pgsql_lock);
+ release_table(table);
return -1;
}
if (pgsql_exec(database, tablename, ast_str_buffer(sql), &result) != 0) {
ast_mutex_unlock(&pgsql_lock);
+ release_table(table);
return -1;
}