Re: Avoid resource leak (src/test/regress/pg_regress.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid resource leak (src/test/regress/pg_regress.c)
Date: 2025-10-24 11:13:04
Message-ID: CAEudQAoruQJ=9VLZS5o1k4HuqZZvHgV0qc5WQ-b6zhz1ScD-2Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em sex., 24 de out. de 2025 às 03:03, Michael Paquier <michael(at)paquier(dot)xyz>
escreveu:

> 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.

Fortunately, this happens less and less.

> This is
> just one of them, allocated in the context of what is a short-term
> execution.
>
In this case, I believe pg_regress is run, thousands of times, on hundreds
of computers.

best regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2025-10-24 11:15:55 Re: Avoid handle leak (src/bin/pg_ctl/pg_ctl.c)
Previous Message Shlok Kyal 2025-10-24 10:34:09 Re: issue with synchronized_standby_slots