pgsql: Fix memory leak in Memoize code

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix memory leak in Memoize code
Date: 2023-10-05 07:31:10
Message-ID: E1qoIpC-0007bG-1y@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix memory leak in Memoize code

Ensure we switch to the per-tuple memory context to prevent any memory
leaks of detoasted Datums in MemoizeHash_hash() and MemoizeHash_equal().

Reported-by: Orlov Aleksej
Author: Orlov Aleksej, David Rowley
Discussion: https://postgr.es/m/83281eed63c74e4f940317186372abfd%40cft.ru
Backpatch-through: 14, where Memoize was added

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0b053e78b5990cd01e7169ee5bd2bb8e4045deea

Modified Files
--------------
src/backend/executor/nodeMemoize.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2023-10-05 07:31:44 pgsql: Fix memory leak in Memoize code
Previous Message Peter Eisentraut 2023-10-05 06:57:25 pgsql: Constify crc32_sz