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

index 42e3cb79bf6e17582e76f83a7d55e5986e98e5a5..c2e3f09cc0e5f0557185578047bb2fd5e147f20f 100644 (file)
@@ -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;
                }