Re: Fix some resources leaks (src/bin/pg_basebackup/pg_createsubscriber.c) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fix some resources leaks (src/bin/pg_basebackup/pg_createsubscriber.c)
Date
Msg-id 1139039.1711993923@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fix some resources leaks (src/bin/pg_basebackup/pg_createsubscriber.c)  ("Euler Taveira" <euler@eulerto.com>)
Responses Re: Fix some resources leaks (src/bin/pg_basebackup/pg_createsubscriber.c)
List pgsql-hackers
"Euler Taveira" <euler@eulerto.com> writes:
> On Wed, Mar 27, 2024, at 8:50 PM, Ranier Vilela wrote:
>> Coverity has some reports in the new code
>> pg_createsubscriber.c
>> I think that Coverity is right.

> It depends on your "right" definition. If your program execution is ephemeral
> and the leak is just before exiting, do you think it's worth it?

I agree with Ranier, actually.  The functions in question don't
exit() themselves, but return control to a caller that might or
might not choose to exit.  I don't think they should be assuming
that an exit will happen promptly, even if that's true today.

The community Coverity run found a few additional leaks of the same
kind in that file.  I pushed a merged fix for all of them.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Imseih (AWS), Sami"
Date:
Subject: Re: Psql meta-command conninfo+
Next
From: "Daniel Verite"
Date:
Subject: Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs