]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #27007 (missing connection closure when connect fails in
authorIlia Alshanetsky <iliaa@php.net>
Thu, 29 Jan 2004 02:55:33 +0000 (02:55 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 29 Jan 2004 02:55:33 +0000 (02:55 +0000)
pgsql)

NEWS
ext/pgsql/pgsql.c

diff --git a/NEWS b/NEWS
index 8111763e6d53eb5cd7ba9ec5d43b6fcdd0500bb8..7a34ea73ca34845e6e6b56f4af42a8b7359d9245 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ PHP 4                                                                      NEWS
 - Fixed bug #27037 (fixed possible crash in apache2handler output code). (Ilia)
 - Fixed bug #27011 (64bit int/long confusion in preg_match*() functions).
   (Ilia)
+- Fixed bug #27007 (missing connection closure when connect fails in pgsql).
+  (Ilia)
 - Fixed bug #26974 (rename() doesn't check the destination file against 
   safe_mode/open_basedir). (Ilia)
 - Fixed bug #26973 (*printf() '+' modifier broken). (Jani)
index 2e369500511b4bfabe7b344d0c78de37b0945596..bef8b187a47b21bc2d5702ad38cf9b97345189c5 100644 (file)
@@ -671,6 +671,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;
                }