From 6ae57f190e276f46bc2d0b616515bed4b4f664ce Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Wed, 13 Sep 2023 14:32:24 +1200 Subject: 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)" Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/PH0PR11MB519113E738814BDDA702EDADD6EFA%40PH0PR11MB5191.namprd11.prod.outlook.com --- src/tools/pgindent/typedefs.list | 1 + 1 file changed, 1 insertion(+) (limited to 'src/tools') diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index e11a650b1c3..46c46cc2539 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -1898,6 +1898,7 @@ ReadExtraTocPtrType ReadFunc ReassignOwnedStmt RecheckForeignScan_function +RecordCacheArrayEntry RecordCacheEntry RecordCompareData RecordIOData -- cgit v1.2.3