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

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix resource leak (src/backend/libpq/be-secure-common.c)
Date: 2024-04-10 18:33:03
Message-ID: F8483DF1-268F-44D3-8D3A-CCB333E2D81F@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 10 Apr 2024, at 20:31, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
>
> Em ter., 2 de abr. de 2024 às 15:31, Daniel Gustafsson <daniel(at)yesql(dot)se <mailto:daniel(at)yesql(dot)se>> escreveu:
>> > On 2 Apr 2024, at 20:13, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com <mailto:ranier(dot)vf(at)gmail(dot)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.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-04-10 18:36:57 Re: psql: Greatly speed up "\d tablename" when not using regexes
Previous Message Jelte Fennema-Nio 2024-04-10 18:31:57 Re: psql: Greatly speed up "\d tablename" when not using regexes