BUG #1558: memory leak in libpq connectDBStart()

Started by Cade Cairnsabout 21 years ago4 messagesbugs
Jump to latest
#1Cade Cairns
cadec@otii.com

The following bug has been logged online:

Bug reference: 1558
Logged by: Cade Cairns
Email address: cadec@otii.com
PostgreSQL version: 8.0.1
Operating system: MacOSX 10.3.8
Description: memory leak in libpq connectDBStart()
Details:

The leak occurs when libpq can not establish a connection to the database
server, in my case when it is not running. I believe that when a caller
calls PQreset() or PQresetStart(), the subsequent call to connectDBStart()
clobbers the previous value of addrlist in the PGconn. Presumably,
closePGconn() should be destroying this value.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Cade Cairns (#1)
Re: BUG #1558: memory leak in libpq connectDBStart()

"Cade Cairns" <cadec@otii.com> writes:

The leak occurs when libpq can not establish a connection to the database
server, in my case when it is not running. I believe that when a caller
calls PQreset() or PQresetStart(), the subsequent call to connectDBStart()
clobbers the previous value of addrlist in the PGconn. Presumably,
closePGconn() should be destroying this value.

Uh ... could we see a complete test case for this?

regards, tom lane

#3Cade Cairns
cadec@otii.com
In reply to: Tom Lane (#2)
Re: BUG #1558: memory leak in libpq connectDBStart()

I will post a patch in a few days. I am extremely busy and don't have
adequate time. I apologize for not having posted more in the first
place.

On 27-Mar-05, at 1:12 AM, Tom Lane wrote:

Show quoted text

"Cade Cairns" <cadec@otii.com> writes:

The leak occurs when libpq can not establish a connection to the
database
server, in my case when it is not running. I believe that when a
caller
calls PQreset() or PQresetStart(), the subsequent call to
connectDBStart()
clobbers the previous value of addrlist in the PGconn. Presumably,
closePGconn() should be destroying this value.

Uh ... could we see a complete test case for this?

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Cade Cairns (#3)
Re: BUG #1558: memory leak in libpq connectDBStart()

Any more information on this?

---------------------------------------------------------------------------

Cade Cairns wrote:

I will post a patch in a few days. I am extremely busy and don't have
adequate time. I apologize for not having posted more in the first
place.

On 27-Mar-05, at 1:12 AM, Tom Lane wrote:

"Cade Cairns" <cadec@otii.com> writes:

The leak occurs when libpq can not establish a connection to the
database
server, in my case when it is not running. I believe that when a
caller
calls PQreset() or PQresetStart(), the subsequent call to
connectDBStart()
clobbers the previous value of addrlist in the PGconn. Presumably,
closePGconn() should be destroying this value.

Uh ... could we see a complete test case for this?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073