Commit 3d07c1ee authored by Zackery Spytz's avatar Zackery Spytz Committed by Inada Naoki

bpo-36412: fix a possible crash in dictobject.c's new_dict() (GH-12519)

parent a7987e71
Fix a possible crash when creating a new dictionary.
...@@ -604,7 +604,9 @@ new_dict(PyDictKeysObject *keys, PyObject **values) ...@@ -604,7 +604,9 @@ new_dict(PyDictKeysObject *keys, PyObject **values)
mp = PyObject_GC_New(PyDictObject, &PyDict_Type); mp = PyObject_GC_New(PyDictObject, &PyDict_Type);
if (mp == NULL) { if (mp == NULL) {
dictkeys_decref(keys); dictkeys_decref(keys);
free_values(values); if (values != empty_values) {
free_values(values);
}
return NULL; return NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment