From: Zeev Suraski Date: Sun, 29 Apr 2001 17:33:11 +0000 (+0000) Subject: Accept the fix suggestion from bug #9562 X-Git-Tag: php-4.0.6RC1~261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6487d08e6bbb1d3955e63934b4994a2ac87f8fd5;p=php Accept the fix suggestion from bug #9562 --- diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 69ddcc4e1b..fa78e38e12 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -376,6 +376,9 @@ void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) pgsql=PQsetdb(host,port,options,tty,dbname); } if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { + if (pgsql) { + PQfinish(pgsql); + } php_error(E_WARNING,"Unable to connect to PostgreSQL server: %s",PQerrorMessage(pgsql)); efree(hashed_details); RETURN_FALSE;