pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix memory leak in Memoize code
Date: Thu, 05 Oct 2023 07:32:32 +0000
Message-ID: <E1qoIqV-0007dx-QZ@gemulon.postgresql.org> (raw)

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
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e4b95b9b02b24c752210839304891e855176e394

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



view thread (4+ messages)

Message-ID: <E1qoIqV-0007dx-QZ@gemulon.postgresql.org>
Permalink:  ../E1qoIqV-0007dx-QZ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qoIqV-0007dx-QZ@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix memory leak in Memoize code
  In-Reply-To: <E1qoIqV-0007dx-QZ@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox