Fix memory leak in Memoize code
authorDavid Rowley <drowley@postgresql.org>
Thu, 5 Oct 2023 07:31:51 +0000 (20:31 +1300)
committerDavid Rowley <drowley@postgresql.org>
Thu, 5 Oct 2023 07:31:51 +0000 (20:31 +1300)
commit689af6db6c76a7966efdb702326f85fa0d8a04ef
tree9130dbb5ade8d6a2e2774c62d310c4543dbfe04c
parent95e91da66cf5bbaf46c34c9386c93004f28d6719
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