Re: Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c) - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c)
Date
Msg-id 20220913140556.6ot7awymd2jyxnkz@jrouhaud
Whole thread Raw
In response to Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List 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.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Splitting up guc.c
Next
From: Alvaro Herrera
Date:
Subject: Re: Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c)