aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-09-13 14:32:24 +1200
committerThomas Munro <tmunro@postgresql.org>2023-09-13 14:50:14 +1200
commit012b80ad20c2f8459d4cbe083e3f0323050d275b (patch)
tree324a4433d53052c9cdd8fe55c6ac2b7d494566a7 /src/backend/access/gist/gist.c
parent7e57208ed51a9f29e7e1a5d103452bc0e54f5a96 (diff)
downloadpostgresql-012b80ad20c2f8459d4cbe083e3f0323050d275b.tar.gz
postgresql-012b80ad20c2f8459d4cbe083e3f0323050d275b.zip
Fix exception safety bug in typcache.c.
If an out-of-memory error was thrown at an unfortunate time, ensure_record_cache_typmod_slot_exists() could leak memory and leave behind a global state that produced an infinite loop on the next call. Fix by merging RecordCacheArray and RecordIdentifierArray into a single array. With only one allocation or re-allocation, there is no intermediate state. Back-patch to all supported releases. Reported-by: "James Pang (chaolpan)" <chaolpan@cisco.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/PH0PR11MB519113E738814BDDA702EDADD6EFA%40PH0PR11MB5191.namprd11.prod.outlook.com
Diffstat (limited to 'src/backend/access/gist/gist.c')
0 files changed, 0 insertions, 0 deletions