From: Ilia Alshanetsky Date: Thu, 29 Jan 2004 02:54:30 +0000 (+0000) Subject: Fixed bug #27007 (missing connection closure when connect fails in pgsql). X-Git-Tag: php-5.0.0b4RC1~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=194509f0932b5776632f310dabd6215fd084e1eb;p=php Fixed bug #27007 (missing connection closure when connect fails in 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; }