Re: Avoid resource leak (src/test/regress/pg_regress.c) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Avoid resource leak (src/test/regress/pg_regress.c)
Date
Msg-id aPsWrwgFW9yiy60F@paquier.xyz
Whole thread Raw
In response to Avoid resource leak (src/test/regress/pg_regress.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Avoid resource leak (src/test/regress/pg_regress.c)
Re: Avoid resource leak (src/test/regress/pg_regress.c)
List pgsql-hackers
On Thu, Oct 23, 2025 at 09:37:21PM -0300, Ranier Vilela wrote:
> The function *config_sspi_auth* is responsible for
> rewrite pg_hba.conf and pg_ident.conf to use SSPI authentication.
>
> Coverity complains that the struct addrinfo gai_result is leaked.
> The variable is declared inside block and is not used
> outside the block.
>
> So if the function WSAStartup is successful then the function getaddrinfo
> allocates and fills the struct addrinfo.
>
> The memory must be released at the end of the block.

Not sure that this one is worth caring about.  We have a bunch of
allocations that we know would be freed once a binary exits.  This is
just one of them, allocated in the context of what is a short-term
execution.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Bryan Green
Date:
Subject: Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Next
From: Michael Paquier
Date:
Subject: Re: Avoid resource leak (src/bin/pg_resetwal/pg_resetwal.c)