Found these "leaks" while doing some other work in the SQL/JSON area. Did some analysis to find that this should be backpatched through 17.
-- Tristan PartinPostgreSQL Contributors TeamAWS (https://aws.amazon.com)