mirror of
https://github.com/python/cpython.git
synced 2026-04-14 15:50:50 +00:00
gh-147960: Fix memory leak in crossinterp _tuple_shared() on alloc failure (#147961)
This commit is contained in:
parent
021ee7fd6a
commit
4810beddbf
1 changed files with 1 additions and 0 deletions
|
|
@ -657,6 +657,7 @@ _tuple_shared(PyThreadState *tstate, PyObject *obj, xidata_fallback_t fallback,
|
|||
shared->items = (_PyXIData_t **) PyMem_Calloc(shared->len, sizeof(_PyXIData_t *));
|
||||
if (shared->items == NULL) {
|
||||
PyErr_NoMemory();
|
||||
PyMem_RawFree(shared);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue