Re: Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c)

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c)
Date: 2022-09-13 14:05:56
Message-ID: 20220913140556.6ot7awymd2jyxnkz@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 13, 2022 at 10:21:22AM -0300, Ranier Vilela wrote:
> Hi,
>
> The commit: Revert SQL/JSON features
> https://github.com/postgres/postgres/commit/2f2b18bd3f554e96a8cc885b177211be12288e4a
>
> Left a little oversight.
> I believe it will be properly corrected when it is applied again.
> However, for Postgres 15 this may can cause a small memory leak.

It's not a memory leak, the chunk will be freed eventually when the owning
memory context is reset, but I agree that one of the two identical
initializations should be removed.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-09-13 14:09:27 Re: Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c)
Previous Message Tom Lane 2022-09-13 14:05:55 Re: Splitting up guc.c