From 11cc289490b7b275fc0a033e2b376a8d4c780d9b Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Thu, 7 Dec 2017 16:24:59 -0800 Subject: [PATCH] Fix missing DECREF of mod. (#4749) --- Python/import.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/import.c b/Python/import.c index cc7417ba84e..dc79685abd4 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1735,6 +1735,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, } } else { + Py_XDECREF(mod); mod = import_find_and_load(abs_name); if (mod == NULL) { goto error;