pgsql: Fix memory leak in ARRAY(SELECT ...) subqueries. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix memory leak in ARRAY(SELECT ...) subqueries.
Date
Msg-id E1Shoup-0000WL-QL@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix memory leak in ARRAY(SELECT ...) subqueries.

Repeated execution of an uncorrelated ARRAY_SUBLINK sub-select (which
I think can only happen if the sub-select is embedded in a larger,
correlated subquery) would leak memory for the duration of the query,
due to not reclaiming the array generated in the previous execution.
Per bug #6698 from Armando Miraglia.  Diagnosis and fix idea by Heikki,
patch itself by me.

This has been like this all along, so back-patch to all supported versions.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/66567ab2c674b958ac7fec47f0c830018245e04a

Modified Files
--------------
src/backend/executor/nodeSubplan.c |   18 +++++++++++++-----
src/include/nodes/execnodes.h      |    1 +
2 files changed, 14 insertions(+), 5 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Repair comment mangled by a pgindent run long ago
Next
From: Tom Lane
Date:
Subject: pgsql: Fix memory leak in ARRAY(SELECT ...) subqueries.