Re: potential memory leak in pg_regcomp()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: potential memory leak in pg_regcomp()
Date: 2022-07-23 03:29:17
Message-ID: YttrDZ/W39IWeNhG@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 22, 2022 at 08:20:04PM -0700, Zhihong Yu wrote:
> Hi,
> I was looking at pg_regcomp():
>
> re->re_guts = VS(MALLOC(sizeof(struct guts)));
>
> I did some search trying to find where re_guts is freed but haven't
> found it.
> Can someone enlighten me?

Oops. It seems that you are right and that there is room for
improvement here. regguts.h defines MALLOC() as a simple malloc()..
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-07-23 03:47:02 Re: Removing obsolete configure checks
Previous Message Michael Paquier 2022-07-23 03:25:23 Re: Make name optional in CREATE STATISTICS