Skip to content

Commit

Permalink
bpo-30547: Fix multiple reference leaks (#1995)
Browse files Browse the repository at this point in the history
Fix regressions introduced by:

- bpo-22257: commits 1abcf67 and 6b4be19

Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
Co-Authored-By: Louie Lu <git@louie.lu>
  • Loading branch information
3 people committed Jun 8, 2017
1 parent 65ece7c commit ab1cb80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Python/pylifecycle.c
Expand Up @@ -302,9 +302,11 @@ initimport(PyInterpreterState *interp, PyObject *sysmod)

/* Install importlib as the implementation of import */
value = PyObject_CallMethod(importlib, "_install", "OO", sysmod, impmod);
if (value != NULL)
if (value != NULL) {
Py_DECREF(value);
value = PyObject_CallMethod(importlib,
"_install_external_importers", "");
}
if (value == NULL) {
PyErr_Print();
Py_FatalError("Py_Initialize: importlib install failed");
Expand All @@ -325,6 +327,7 @@ initexternalimport(PyInterpreterState *interp)
PyErr_Print();
Py_FatalError("Py_EndInitialization: external importer setup failed");
}
Py_DECREF(value);
}


Expand Down

0 comments on commit ab1cb80

Please sign in to comment.