From 84c69bce247c469892251f1fb836ab72311fb907 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 25 Feb 2019 22:31:12 -0800 Subject: [PATCH] Fix some reference leaks in typeobject.c. a24107b04c1277e3c1105f98aff5bfa3a98b33a0 introduced a few refleaks. --- Objects/typeobject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index e559c643ec9172a..403f3caaee6ae92 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; }