From: Benjamin Peterson Date: Tue, 26 Feb 2019 07:12:10 +0000 (-0800) Subject: closes bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045) X-Git-Tag: v3.8.0a3~225 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5a551c2694e32835bcdafc01d611f3227ca36b3;p=thirdparty%2FPython%2Fcpython.git closes bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045) a24107b04c1277e3c1105f98aff5bfa3a98b33a0 introduced a few refleaks. https://bugs.python.org/issue36115 --- 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; }