Re: Potential memory leak in contrib/intarray's g_intbig_compress

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Konstantin Knizhnik <knizhnik(at)garret(dot)ru>
Subject: Re: Potential memory leak in contrib/intarray's g_intbig_compress
Date: 2023-08-02 11:44:42
Message-ID: CAEze2Wjm_Zb=WV8VJFOdszrUGbC3kfVTRE2=ty5iAYkyhJukYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 14 Jul 2023 at 07:57, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Jul 13, 2023 at 06:28:39PM +0200, Matthias van de Meent wrote:
> > There are similar pfree calls in the _int_gist.c file's g_int_compress
> > function, which made me think we do need to clean up after use, but
> > indeed these pfrees are useless (or even harmful if bug #17888 can be
> > trusted)
>
> Indeed, all these are in a GiST temporary context. So you'd mean
> something like the attached perhaps, for both the decompress and
> compress paths?

Yes, looks good to me. Thanks!

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Melih Mutlu 2023-08-02 11:57:35 Re: Adding a LogicalRepWorker type field
Previous Message Richard Guo 2023-08-02 11:02:38 Re: Oversight in reparameterize_path_by_child leading to executor crash