php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9562 Memory leak in ext/pgsql/pgsql.c
Submitted: 2001-03-05 10:11 UTC Modified: 2001-04-29 13:35 UTC
From: ales at deuce dot sta dot si Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.4pl1 OS: Solaris, probably also others
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ales at deuce dot sta dot si
New email:
PHP Version: OS:

 

 [2001-03-05 10:11 UTC] ales at deuce dot sta dot si
Script for reproducing bug:

while(!($con=@pg_pconnect("dbname=web")))
{
   sleep(1);
}

The system must be under heavy load for bug to become apparent.

Suggested correction in ext/pgsql/pgsql.c (added lines are marked with ***):

if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) {
***   if(pgsql) {
***      PQfinish(pgsql);
***      pgsql=0;
***   }
    php_error(E_WARNING,"Unable to connect to PostgreSQL server:  %s",PQerrorMessage(pgsql));
    efree(hashed_details);
    RETURN_FALSE;
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-29 13:35 UTC] zeev@php.net
Your fix was incorporated to the CVS, and will be a part of PHP 4.0.6.  Thanks!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 11:01:30 2025 UTC