Re: ParseTzFile doesn't FreeFile on error
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2022-05-31T18:21:28Z
Lists: pgsql-hackers
Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes: > At Mon, 30 May 2022 13:11:04 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in >> BTW, my first thought about it was "what if one of the callees throws >> elog(ERROR), eg palloc out-of-memory"? But I think that's all right >> since then we'll reach transaction abort cleanup, which won't whine >> about open files. The problem is limited to the case where no error >> gets thrown. > Right. This "issue" is not a problem unless the caller continues > without throwing an exception after the function errors out, which is > not done by the current code. Actually the problem *is* reachable, if you intentionally break the already-active timezone abbreviation file: newly started sessions produce file-leak warnings after failing to apply the setting. I concede that's not a likely scenario, but that's why I think it's worth fixing. regards, tom lane
Commits
-
Ensure ParseTzFile() closes the input file after failing.
- c73748b68a0e 13.8 landed
- c47a558528dd 14.4 landed
- ae758e603d5c 11.17 landed
- a3faebd6a58a 12.12 landed
- 2114910cae6a 10.22 landed
- 16c80e7d0cda 15.0 landed