mirror of https://github.com/python/cpython
bpo-36412: fix a possible crash in dictobject.c's new_dict() (GH-12519)
This commit is contained in:
parent
a7987e7193
commit
3d07c1ee1d
|
@ -0,0 +1 @@
|
|||
Fix a possible crash when creating a new dictionary.
|
|
@ -604,7 +604,9 @@ new_dict(PyDictKeysObject *keys, PyObject **values)
|
|||
mp = PyObject_GC_New(PyDictObject, &PyDict_Type);
|
||||
if (mp == NULL) {
|
||||
dictkeys_decref(keys);
|
||||
free_values(values);
|
||||
if (values != empty_values) {
|
||||
free_values(values);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue