Re: pg_dump: fix memory leak - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: pg_dump: fix memory leak
Date
Msg-id DD787428-D933-4598-BFB6-11CC37F12811@yesql.se
Whole thread Raw
In response to pg_dump: fix memory leak  (m.korotkov@postgrespro.ru)
List pgsql-hackers
> On 29 Aug 2025, at 09:36, m.korotkov@postgrespro.ru wrote:
>
> Daniel Gustafsson wrote 2025-08-29 10:13:
>> This is not actually a leak since the application will terminate immediately if
>> a restrict key cannot be generated.
> I agree that the current usage of the function does not present a problem, but there is no certainty that this
situationwill remain unchanged. 

I certainly hope it won't change, ignoring a failure from pg_strong_random() is
a seriously bad idea.  If the function is rewritten to change its errorhandling
then allocation might be changed, right now there is no leak and no bug.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: Adding REPACK [concurrently]
Next
From: Chao Li
Date:
Subject: Trivial fix of code comment