From 278c876dfbd02ed2e5fcfd33a0eb8f8b71a1617d Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Tue, 4 Dec 2018 23:27:49 -0700 Subject: [PATCH] bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule() --- Python/pystate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/pystate.c b/Python/pystate.c index f86f5a96f07450..98882eb7589c6f 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -592,6 +592,7 @@ PyState_RemoveModule(struct PyModuleDef* def) Py_FatalError("PyState_RemoveModule: Module index out of bounds."); return -1; } + Py_INCREF(Py_None); return PyList_SetItem(state->modules_by_index, index, Py_None); }