bpo-36374: Fix a possible null pointer dereference (GH-12449)

https://bugs.python.org/issue36374
This commit is contained in:
Zackery Spytz 2019-03-20 03:16:25 -06:00 committed by Miss Islington (bot)
parent fa15376848
commit 9b4a1b1e23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
Fix a possible null pointer dereference in ``merge_consts_recursive()``.
Patch by Zackery Spytz.

View file

@ -1210,7 +1210,7 @@ merge_consts_recursive(struct compiler *c, PyObject *o)
PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key);
if (t != key) {
// o is registered in c_const_cache. Just use it.
Py_INCREF(t);
Py_XINCREF(t);
Py_DECREF(key);
return t;
}