Fixed bug: #11728. Error message was cleared before outputted in pg_pconnect()

This commit is contained in:
foobar 2001-06-29 03:12:06 +00:00
parent 5c8035e346
commit bc3482d65f

View File

@ -434,10 +434,10 @@ void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
pgsql=PQsetdb(host,port,options,tty,dbname);
}
if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) {
php_error(E_WARNING,"Unable to connect to PostgreSQL server: %s",PQerrorMessage(pgsql));
if (pgsql) {
PQfinish(pgsql);
}
php_error(E_WARNING,"Unable to connect to PostgreSQL server: %s",PQerrorMessage(pgsql));
efree(hashed_details);
RETURN_FALSE;
}