From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 21 Jul 2023 11:48:50 +0000 (-0700) Subject: [3.12] gh-47146: Fix reference counting in _testcapi.structmember initializer (GH... X-Git-Tag: v3.12.0rc1~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4be0f157ea7000ded8d4a3ae818a74b026f1fed3;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-47146: Fix reference counting in _testcapi.structmember initializer (GH-106862) (GH-106953) (cherry picked from commit 8d397ee8259fa0f81598a452438fc335267ca260) Co-authored-by: Serhiy Storchaka --- diff --git a/Modules/_testcapi/structmember.c b/Modules/_testcapi/structmember.c index 0fb872a4328d..641b003e56d3 100644 --- a/Modules/_testcapi/structmember.c +++ b/Modules/_testcapi/structmember.c @@ -194,7 +194,7 @@ _PyTestCapi_Init_Structmember(PyObject *m) if (res < 0) { return -1; } - res = PyModule_AddObject( + res = PyModule_AddObjectRef( m, "_test_structmembersType_OldAPI", (PyObject *)&test_structmembersType_OldAPI);