From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 10 Jan 2019 16:36:50 +0000 (-0800) Subject: bpo-35470: Fix a reference counting bug in _PyImport_FindExtensionObjectEx(). (GH... X-Git-Tag: v3.7.3rc1~158 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e3d57d8490b729a80c8cd9e90475dec122dfe9e;p=thirdparty%2FPython%2Fcpython.git bpo-35470: Fix a reference counting bug in _PyImport_FindExtensionObjectEx(). (GH-11128) (cherry picked from commit 89c4f90df97f6039325e354167e8f507bf199fd9) Co-authored-by: Zackery Spytz --- diff --git a/Python/import.c b/Python/import.c index 5f5d135c7a2e..ccdd59930505 100644 --- a/Python/import.c +++ b/Python/import.c @@ -743,7 +743,6 @@ _PyImport_FindExtensionObjectEx(PyObject *name, PyObject *filename, } if (_PyState_AddModule(mod, def) < 0) { PyMapping_DelItem(modules, name); - Py_DECREF(mod); return NULL; } if (Py_VerboseFlag)