Re: Is there a memory leak in commit 8561e48? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is there a memory leak in commit 8561e48?
Date
Msg-id 22655.1525189335@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is there a memory leak in commit 8561e48?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: Is there a memory leak in commit 8561e48?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> The memory leak can be fixed by adding a pfree().

That seems like an odd way to approach this.  Why not just remove the
reset of _SPI_stack and _SPI_stack_depth, so as to subtract code rather
than adding it --- that is, make it actually work like you mistakenly
thought it did?  If we're going to keep the stack in TopMemoryContext,
there's no need to thrash it on every transaction.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: stats_ext test fails with -DCATCACHE_FORCE_RELEASE
Next
From: Tom Lane
Date:
Subject: Re: Patch missing from back branches