Re: Fix memleaks and error handling in jsonb_plpython

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix memleaks and error handling in jsonb_plpython
Date: 2019-04-06 21:56:24
Message-ID: 15889.1554587784@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> On Wed, Mar 06, 2019 at 11:04:23AM +0900, Michael Paquier wrote:
>> Another thing is that you cannot just return within a try block with
>> what is added in PLyObject_FromJsonbContainer, or the error stack is
>> not reset properly. So they should be replaced by breaks.

> So, I have been poking at this stuff, and I am finishing with the
> attached.

This patch had bit-rotted due to somebody else fooling with the
volatile-qualifiers situation. I fixed it up, tweaked a couple of
things, and pushed it.

> Also, as all those
> problems are really unlikely going to happen in real-life cases,
> improving this code only on HEAD looks enough to me.

Yeah, I concur.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-04-06 22:10:06 Re: jsonpath
Previous Message David Steele 2019-04-06 20:54:19 Re: INSTALL file