Re: Memory leak in CachememoryContext

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ajit Awekar <ajit.awekar@enterprisedb.com>, pgsql-hackers@lists.postgresql.org, Rushabh Lathia <rushabh.lathia@enterprisedb.com>, Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Date: 2023-04-24T13:55:41Z
Lists: pgsql-hackers
On 2023-Apr-21, Tom Lane wrote:

> (Note to self: we can't remove the cast_hash_context field in
> back branches for fear of causing an ABI break for pldebugger.
> But we can leave it unused, I think.)

Hmm, we can leave it unused in our code, but it still needs to be
initialized to some valid memory context anyway; otherwise hypothetical
code that uses it would still crash.  This seems halfway obvious, but
since the submitted patch doesn't have this part, I thought better to
point it out.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



Commits

  1. Fix memory leakage in plpgsql DO blocks that use cast expressions.