Re: [bug fix] Memory leak in dblink - Mailing list pgsql-hackers

From MauMau
Subject Re: [bug fix] Memory leak in dblink
Date
Msg-id 7C32B1D8BD284836836C8A2D16BFC7D3@maumau
Whole thread Raw
In response to Re: [bug fix] Memory leak in dblink  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [bug fix] Memory leak in dblink
List pgsql-hackers
From: "Amit Kapila" <amit.kapila16@gmail.com>
> 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.

I thought the same, but I also felt that I should make an effort to release
resources as soon as possible, considering the memory context auto deletion
as a last resort.  However, looking at other places where PG_CATCH() is
used, memory context is not deleted.  So, I removed the modification from
PG_CATCH() block.  Thanks.

Regards
MauMau


Attachment

pgsql-hackers by date:

Previous
From:
Date:
Subject: Re: pg_xlogdump --stats
Next
From: Hannu Krosing
Date:
Subject: Re: "RETURNING PRIMARY KEY" syntax extension