[Python-checkins] closes bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045)

Miss Islington (bot) webhook-mailer at python.org
Tue Feb 26 02:12:14 EST 2019


https://github.com/python/cpython/commit/d5a551c2694e32835bcdafc01d611f3227ca36b3
commit: d5a551c2694e32835bcdafc01d611f3227ca36b3
branch: master
author: Benjamin Peterson <benjamin at python.org>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-02-25T23:12:10-08:00
summary:

closes bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045)



a24107b04c1277e3c1105f98aff5bfa3a98b33a0 introduced a few refleaks.





https://bugs.python.org/issue36115

files:
M Objects/typeobject.c

diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index e559c643ec91..403f3caaee6a 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4962,6 +4962,7 @@ add_getset(PyTypeObject *type, PyGetSetDef *gsp)
             return -1;
 
         if (PyDict_GetItemWithError(dict, PyDescr_NAME(descr))) {
+            Py_DECREF(descr);
             continue;
         }
         else if (PyErr_Occurred()) {
@@ -7689,6 +7690,7 @@ super_getattro(PyObject *self, PyObject *name)
             return res;
         }
         else if (PyErr_Occurred()) {
+            Py_DECREF(mro);
             return NULL;
         }
 



More information about the Python-checkins mailing list