[Python-checkins] gh-93747: Fix Refleak when handling multiple Py_tp_doc slots (gh-93749)

corona10 webhook-mailer at python.org
Sun Jun 12 11:55:10 EDT 2022


https://github.com/python/cpython/commit/ae1ca74513e792b09c8057a87aa28715b5c9f50b
commit: ae1ca74513e792b09c8057a87aa28715b5c9f50b
branch: main
author: Dong-hee Na <donghee.na at python.org>
committer: corona10 <donghee.na92 at gmail.com>
date: 2022-06-13T00:55:01+09:00
summary:

gh-93747: Fix Refleak when handling multiple Py_tp_doc slots (gh-93749)

files:
M Objects/typeobject.c

diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index e57651446f888..18094bd43dd3a 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3569,7 +3569,7 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
                 PyErr_SetString(
                     PyExc_SystemError,
                     "Multiple Py_tp_doc slots are not supported.");
-                return NULL;
+                goto finally;
             }
             if (slot->pfunc == NULL) {
                 type->tp_doc = NULL;



More information about the Python-checkins mailing list