Fix memory leak in Memoize code
authorDavid Rowley <[email protected]>
Thu, 5 Oct 2023 07:31:25 +0000 (20:31 +1300)
committerDavid Rowley <[email protected]>
Thu, 5 Oct 2023 07:31:25 +0000 (20:31 +1300)
commit31b2b2d72d9c50be415c6340ebf4ad83a472590c
tree35db3db17b22b56654afe9b6775c388400f3d427
parent75f31a3f26744ca71a4214d4ab0c7f6cac4a0421
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