From: Antoine Pitrou Date: Wed, 18 Jan 2012 20:29:05 +0000 (+0100) Subject: Fix some of the remaining test_capi refleaks X-Git-Tag: v3.3.0a1~350 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b0a74e93680b8142d016d7a006939d97e33f044;p=thirdparty%2FPython%2Fcpython.git Fix some of the remaining test_capi refleaks --- diff --git a/Objects/exceptions.c b/Objects/exceptions.c index ab71605f495c..fc299f599e6f 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2225,6 +2225,7 @@ PyObject *PyExc_RecursionErrorInst = NULL; Py_FatalError("Module dictionary insertion problem."); #define INIT_ALIAS(NAME, TYPE) Py_INCREF(PyExc_ ## TYPE); \ + Py_XDECREF(PyExc_ ## NAME); \ PyExc_ ## NAME = PyExc_ ## TYPE; \ if (PyDict_SetItemString(bdict, # NAME, PyExc_ ## NAME)) \ Py_FatalError("Module dictionary insertion problem."); @@ -2234,6 +2235,7 @@ PyObject *PyExc_RecursionErrorInst = NULL; assert(_PyObject_RealIsSubclass(PyExc_ ## TYPE, PyExc_OSError)); \ if (!_code || PyDict_SetItem(errnomap, _code, PyExc_ ## TYPE)) \ Py_FatalError("errmap insertion problem."); \ + Py_DECREF(_code); \ } #ifdef MS_WINDOWS