Skip to content

Commit

Permalink
MFH: Fixed bug #27007 (missing connection closure when connect fails in
Browse files Browse the repository at this point in the history
pgsql)
  • Loading branch information
Ilia Alshanetsky committed Jan 29, 2004
1 parent 66fee7d commit 1ca21fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions ext/pgsql/pgsql.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1ca21fd

Please sign in to comment.