summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-03-20 13:28:47 +1300
committerDavid Rowley <drowley@postgresql.org>2023-03-20 13:28:47 +1300
commit579ee5df14dfcf5213e502bb096121d2249167c2 (patch)
tree566cd9d835d98528ce0448fc3485b1f14f1363de /src/backend/access/gist/gist.c
parente060cd59fabda2a0b2a7e119a58887791d030942 (diff)
downloadpostgresql-579ee5df14dfcf5213e502bb096121d2249167c2.tar.gz
Fix memory leak in Memoize cache key evaluation
When probing the Memoize cache to check if the current cache key values exist in the cache, we perform an evaluation of the expressions making up the cache key before probing the hash table for those values. This operation could leak memory as it is possible that the cache key is an expression which requires allocation of memory, as was the case in bug 17844. Here we fix this by correctly switching to the per tuple context before evaluating the cache expressions so that the memory is freed next time the per tuple context is reset. Bug: 17844 Reported-by: Alexey Ermakov Discussion: https://postgr.es/m/17844-d2f6f9e75a622bed@postgresql.org Backpatch-through: 14, where Memoize was introduced
Diffstat (limited to 'src/backend/access/gist/gist.c')
0 files changed, 0 insertions, 0 deletions