Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdad8bed

Browse files
committed
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 documentationPyList_GetItem() and PyTuple_GetItem() return a borrowed reference whilePySequence_GetItem() returns new reference. contrib/jsonb_plpython is newin PostgreSQL 11, no backpatch is needed.Author: Nikita GlukhovDiscussion:https://postgr.es/m/6001af16-b242-2527-bc7e-84b8a959163b%40postgrespro.ru
1 parent969274d commitdad8bed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎contrib/jsonb_plpython/jsonb_plpython.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ PLySequence_ToJsonbValue(PyObject *obj, JsonbParseState **jsonb_state)
308308
PyObject*value=PySequence_GetItem(obj,i);
309309

310310
(void)PLyObject_ToJsonbValue(value,jsonb_state, true);
311+
312+
Py_XDECREF(value);
311313
}
312314

313315
returnpushJsonbValue(jsonb_state,WJB_END_ARRAY,NULL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp