Re: Fix memory leak in tzparser.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Shixin Wang <wang-shi-xin(at)outlook(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix memory leak in tzparser.c
Date: 2025-12-17 15:49:05
Message-ID: 2629855.1765986545@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> writes:
> On Tue, Dec 16, 2025 at 1:29 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>> Why does it matter? load_tzoffsets() is the sole caller of
>> ParseTzFile() and it uses a temporary memory context named
>> TZParserMemory to not have to do cleanups like the one you are
>> proposing here.

> +1. But maybe Shixin has seen a scenario where this temporary
> accumulation has caused some problems because say there were many
> entries whose zone was replaced? Shixin, what problem did you see
> which prompted you to create this patch?

There are only several hundred timezone names in the entire world,
so it's really difficult to believe any interesting amount of
transient memory consumption here.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2025-12-17 15:55:07 Re: pgsql: Revert "Avoid requiring Spanish locale to test NLS infrastructur
Previous Message Heikki Linnakangas 2025-12-17 15:42:41 Re: Visibility bug in tuple lock