pgsql: Ensure ParseTzFile() closes the input file after failing.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Ensure ParseTzFile() closes the input file after failing.
Date: 2022-05-31 18:47:58
Message-ID: E1nw6uM-0024Hp-6k@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Ensure ParseTzFile() closes the input file after failing.

We hadn't noticed this because (a) few people feed invalid
timezone abbreviation files to the server, and (b) in typical
scenarios guc.c would throw ereport(ERROR) and then transaction
abort handling would silently clean up the leaked file reference.
However, it was possible to observe file leakage warnings if one
breaks an already-active abbreviation file, because guc.c does
not throw ERROR when loading supposedly-validated settings during
session start or SIGHUP processing.

Report and fix by Kyotaro Horiguchi (cosmetic adjustments by me)

Discussion: https://postgr.es/m/20220530.173740.748502979257582392.horikyota.ntt@gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a3faebd6a58aaff0d6521428831041d517db62fe

Modified Files
--------------
src/backend/utils/misc/tzparser.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2022-05-31 19:25:52 pgsql: Revert changes to CONCURRENTLY that "sped up" Xmin advance
Previous Message Tom Lane 2022-05-31 16:18:57 pgsql: Doc: fix mention of pg_dump's minimum supported server version.