pgsql: Fix memory leak in PLySequence_ToJsonbValue()

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix memory leak in PLySequence_ToJsonbValue()
Date: 2018-06-15 12:06:47
Message-ID: E1fTnV9-0006fJ-QD@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix memory leak in PLySequence_ToJsonbValue()

PyObject returned from PySequence_GetItem() is not released. Similar code in PLyMapping_ToJsonbValue() is correct, because according to Python documentation
PyList_GetItem() and PyTuple_GetItem() return a borrowed reference while
PySequence_GetItem() returns new reference. contrib/jsonb_plpython is new
in PostgreSQL 11, no backpatch is needed.

Author: Nikita Glukhov
Discussion: https://postgr.es/m/6001af16-b242-2527-bc7e-84b8a959163b%40postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dad8bed04ab98ada84ecd58ace6f59839aa161c4

Modified Files
--------------
contrib/jsonb_plpython/jsonb_plpython.c | 2 ++
1 file changed, 2 insertions(+)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2018-06-15 12:09:15 Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()
Previous Message Tatsuo Ishii 2018-06-15 07:41:57 pgsql: Fix memory leak.