pgsql: Eliminate memory leaks in plperl's spi_prepare() function.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Eliminate memory leaks in plperl's spi_prepare() function.
Date: 2013-03-02 02:34:54
Message-ID: E1UBcHm-00060b-3g@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Eliminate memory leaks in plperl's spi_prepare() function.

Careless use of TopMemoryContext for I/O function data meant that repeated
use of spi_prepare and spi_freeplan would leak memory at the session level,
as per report from Christian Schröder. In addition, spi_prepare
leaked a lot of transient data within the current plperl function's SPI
Proc context, which would be a problem for repeated use of spi_prepare
within a single plperl function call; and it wasn't terribly careful
about releasing permanent allocations in event of an error, either.

In passing, clean up some copy-and-pasteos in query-lookup error messages.

Alex Hunsaker and Tom Lane

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0fe397fa49559f78d2cbffa6f2422d65d9e0e143

Modified Files
--------------
src/pl/plperl/plperl.c | 116 ++++++++++++++++++++++++++++++------------------
1 files changed, 72 insertions(+), 44 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2013-03-02 03:52:18 pgsql: Exclude utils/probes.h and pg_trace.h from cpluspluscheck
Previous Message Ants Aasma 2013-03-01 15:01:27 Re: Materialized views WIP patch