Skip to content

Commit

Permalink
Fixed crash in case new connection cannot be opened
Browse files Browse the repository at this point in the history
  • Loading branch information
vladpaiu committed Feb 7, 2019
1 parent c8907aa commit 39f205c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/db_postgres/pg_con.c
Expand Up @@ -149,7 +149,9 @@ struct pg_con* db_postgres_new_connection(struct db_id* id)
struct pg_con* db_postgres_new_async_connection(struct db_id* id)
{
struct pg_con * ret = db_postgres_new_connection(id);
PQsetnonblocking(ret->con, 1);
if (ret) {
PQsetnonblocking(ret->con, 1);
}

return ret;
}
Expand Down

0 comments on commit 39f205c

Please sign in to comment.