Re: SRF memory leaks - Mailing list pgsql-patches

From Tom Lane
Subject Re: SRF memory leaks
Date
Msg-id 6684.1204142845@sss.pgh.pa.us
Whole thread Raw
In response to Re: SRF memory leaks  (Neil Conway <neilc@samurai.com>)
Responses Re: SRF memory leaks  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> On Tue, 2008-02-26 at 00:17 -0800, Neil Conway wrote:
>> You didn't comment on my proposed solution (FreeTupleDesc() iff refcount
>> == -1).

I still find that entirely unsafe, particularly for something you
propose to back-patch into stable branches.  Negative refcount does
not prove that the SRF itself hasn't still got a pointer to the tupdesc.

Can't we fix it so that the tupdesc is allocated in the new special
context (at least in the primary code paths), and then no explicit
free is needed?

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: SRF memory leaks
Next
From: Neil Conway
Date:
Subject: Re: SRF memory leaks