From 194509f0932b5776632f310dabd6215fd084e1eb Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 29 Jan 2004 02:54:30 +0000 Subject: Fixed bug #27007 (missing connection closure when connect fails in pgsql). --- ext/pgsql/pgsql.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/pgsql') diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 42e3cb79bf..c2e3f09cc0 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -694,6 +694,9 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { PHP_PQ_ERROR("Unable to connect to PostgreSQL server: %s", pgsql); + if (pgsql) { + PQfinish(pgsql); + } goto err; } -- cgit v1.2.1