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

Commite01b04c

Browse files
gh-104614: Fix potential ref. leak in _testcapimodule/get_basic_static_type() (#105225)
1 parent0dafc78 commite01b04c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎Modules/_testcapimodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2671,13 +2671,15 @@ get_basic_static_type(PyObject *self, PyObject *args)
26712671
PyTypeObject*cls=&BasicStaticTypes[num_basic_static_types_used++];
26722672

26732673
if (base!=NULL) {
2674-
cls->tp_base= (PyTypeObject*)Py_NewRef(base);
26752674
cls->tp_bases=Py_BuildValue("(O)",base);
26762675
if (cls->tp_bases==NULL) {
26772676
returnNULL;
26782677
}
2678+
cls->tp_base= (PyTypeObject*)Py_NewRef(base);
26792679
}
26802680
if (PyType_Ready(cls)<0) {
2681+
Py_DECREF(cls->tp_bases);
2682+
Py_DECREF(cls->tp_base);
26812683
returnNULL;
26822684
}
26832685
return (PyObject*)cls;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp