mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-36412: fix a possible crash in dictobject.c's new_dict() (GH-12519)
This commit is contained in:
parent
a7987e7193
commit
3d07c1ee1d
2 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue