Re: Fix resource leak (src/backend/libpq/be-secure-common.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Fix resource leak (src/backend/libpq/be-secure-common.c)
Date
Msg-id CAEudQAoQ6pVAu4JS-KPgkPW_Nvb0bUbjGtYEwa7ADGOxQ=KVug@mail.gmail.com
Whole thread Raw
In response to Re: Fix resource leak (src/backend/libpq/be-secure-common.c)  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Fix resource leak (src/backend/libpq/be-secure-common.c)
List pgsql-hackers
Em qua., 10 de abr. de 2024 às 15:33, Daniel Gustafsson <daniel@yesql.se> escreveu:
On 10 Apr 2024, at 20:31, Ranier Vilela <ranier.vf@gmail.com> wrote:

Em ter., 2 de abr. de 2024 às 15:31, Daniel Gustafsson <daniel@yesql.se> escreveu:
> On 2 Apr 2024, at 20:13, Ranier Vilela <ranier.vf@gmail.com> wrote:

> Fix by freeing the pointer, like pclose_check (src/common/exec.c) similar case.

Off the cuff, seems reasonable when loglevel is LOG.

Per Coverity.

Another case of resource leak, when loglevel is LOG.
In the function shell_archive_file (src/backend/archive/shell_archive.c)
The pointer *xlogarchcmd*  is not freed.

Thanks, I'll have a look.  I've left this for post-freeze on purpose to not
cause unnecessary rebasing.  Will take a look over the next few days unless
beaten to it.
Any chance we'll have these fixes in v17?

best regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Re: Fix out-of-bounds in the function GetCommandTagName
Next
From: Daniel Gustafsson
Date:
Subject: Re: Fix resource leak (src/backend/libpq/be-secure-common.c)