]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 5 Dec 2018 07:51:08 +0000 (23:51 -0800)
committerGitHub <noreply@github.com>
Wed, 5 Dec 2018 07:51:08 +0000 (23:51 -0800)
(cherry picked from commit 2a893430c9c8378cbdfac95895a64fa07aaff9ed)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Python/pystate.c

index 15761e7da90f8e38afcdfe9c89863be0a46fc2ca..8077a3ee7ab0282c34b2e2b4aad7b416a4cb3fe4 100644 (file)
@@ -532,6 +532,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);
 }