mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
GH-89988: Fix memory leak in pickle.Pickler dispatch_table lookup (GH-94298)
This commit is contained in:
parent
e6391e08bf
commit
01ef1f95da
3 changed files with 27 additions and 1 deletions
|
@ -4761,7 +4761,9 @@ _pickle_Pickler___init___impl(PicklerObject *self, PyObject *file,
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (self->dispatch_table != NULL) {
|
||||
return 0;
|
||||
}
|
||||
if (_PyObject_LookupAttr((PyObject *)self, &_Py_ID(dispatch_table),
|
||||
&self->dispatch_table) < 0) {
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue