Fix memleaks and error handling in jsonb_plpython - Mailing list pgsql-hackers

From Nikita Glukhov
Subject Fix memleaks and error handling in jsonb_plpython
Date
Msg-id 28053a7d-10d8-fc23-b05c-b4749c873f63@postgrespro.ru
Whole thread Raw
Responses Re: Fix memleaks and error handling in jsonb_plpython
List pgsql-hackers
Unfortunately, contrib/jsonb_plpython still contain a lot of problems in error 
handling that can lead to memory leaks:- not all Python function calls are checked for the success- not in all places PG exceptions are caught to release Python references
But it seems that this errors can happen only in OOM case.

Attached patch with the fix. Back-patch for PG11 is needed.

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: pgsql: Avoid creation of the free space map for small heaprelations, t
Next
From: Richard Guo
Date:
Subject: Re: NOT IN subquery optimization