Fix memleaks and error handling in jsonb_plpython

From: Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix memleaks and error handling in jsonb_plpython
Date: 2019-03-01 02:24:39
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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:
The Russian Postgres Company

Attachment Content-Type Size
0001-Fix-memleaks-and-error-handling-in-jsonb_plpython-v01.patch text/x-patch 5.8 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2019-03-01 02:27:04 Re: NOT IN subquery optimization
Previous Message Amit Kapila 2019-03-01 02:19:46 Re: pgsql: Avoid creation of the free space map for small heap relations, t