Check connection string right before we connect

This commit is contained in:
Joris Vink 2014-04-14 08:45:31 +02:00
parent 6cabe00740
commit a35a5182a7
1 changed files with 3 additions and 3 deletions

View File

@ -56,9 +56,6 @@ char *pgsql_conn_string = NULL;
void
kore_pgsql_init(void)
{
if (pgsql_conn_string == NULL)
fatal("No pgsql connection string set");
pgsql_conn_count = 0;
TAILQ_INIT(&pgsql_conn_free);
}
@ -247,6 +244,9 @@ pgsql_conn_create(struct http_request *req, int idx)
{
struct pgsql_conn *conn;
if (pgsql_conn_string == NULL)
fatal("pgsql_conn_create: no connection string");
pgsql_conn_count++;
conn = kore_malloc(sizeof(*conn));
kore_debug("pgsql_conn_create(): %p", conn);