Fix memory leak in Memoize code
authorDavid Rowley <drowley@postgresql.org>
Thu, 5 Oct 2023 07:30:47 +0000 (20:30 +1300)
committerDavid Rowley <drowley@postgresql.org>
Thu, 5 Oct 2023 07:30:47 +0000 (20:30 +1300)
commit0b053e78b5990cd01e7169ee5bd2bb8e4045deea
treef18695f27e0905a6e9bdd37a8ade115f0f77aa39
parent688926633fc6663d632334b17b34b0384620a458
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
src/backend/executor/nodeMemoize.c