mirror of
https://github.com/python/cpython.git
synced 2026-06-23 03:23:38 -04:00
gh-147960: Fix memory leak in crossinterp _tuple_shared() on alloc failure (#147961)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user