summaryrefslogtreecommitdiff
path: root/src/tools/pgindent
diff options
context:
space:
mode:
authorThomas Munro2023-09-13 02:32:24 +0000
committerThomas Munro2023-09-13 02:52:34 +0000
commit6ae57f190e276f46bc2d0b616515bed4b4f664ce (patch)
tree545a882a6bc83b1b8874ff985922368c810bd660 /src/tools/pgindent
parentfeb4e218e5f9d8ec2d0c6f2eac28ad786ea9d79c (diff)
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/tools/pgindent')
-rw-r--r--src/tools/pgindent/typedefs.list1
1 files changed, 1 insertions, 0 deletions
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