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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
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-07-14 05:57:29
Message-ID: ZLDjyfq9cT4+Vu0u@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?
--
Michael

Attachment Content-Type Size
intarray-pfree.patch text/x-diff 803 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2023-07-14 06:51:17 Re: logical decoding and replication of sequences, take 2
Previous Message Martin Butter 2023-07-14 05:53:14 16beta2 SQL parser: different defaults on absent_on_null