Re: [bug fix] Memory leak in dblink

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: MauMau <maumau307(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] Memory leak in dblink
Date: 2014-06-10 14:00:05
Message-ID: CA+TgmoYgyWceLzUnk4+YKC3xgxtkKbp836SmOnBVPxi0MeKoyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 10, 2014 at 12:27 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> Is there a need to free memory context in PG_CATCH()?
> In error path the memory due to this temporary context will get
> freed as it will delete the transaction context and this
> temporary context will definitely be in the hierarchy of it, so
> it should also get deleted. I think such handling can be
> useful incase we use PG_CATCH() to suppress the error.

Using PG_CATCH() to suppress an error is pretty much categorically unsafe.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-06-10 14:02:28 Re: /proc/self/oom_adj is deprecated in newer Linux kernels
Previous Message Robert Haas 2014-06-10 13:53:17 Re: why postgresql define NTUP_PER_BUCKET as 10, not other numbers smaller