]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Ensure ParseTzFile() closes the input file after failing.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 May 2022 18:47:44 +0000 (14:47 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 May 2022 18:47:44 +0000 (14:47 -0400)
commita3faebd6a58aaff0d6521428831041d517db62fe
treeeb4b9822db26b2a812945437924734e43b281213
parentfa70c9e0219fe4b8e1a6c35d1425f8fd7772f62d
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
src/backend/utils/misc/tzparser.c