Skip to content

Commit 4810bed

Browse files
gh-147960: Fix memory leak in crossinterp _tuple_shared() on alloc failure (#147961)
1 parent 021ee7f commit 4810bed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/crossinterp_data_lookup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ _tuple_shared(PyThreadState *tstate, PyObject *obj, xidata_fallback_t fallback,
657657
shared->items = (_PyXIData_t **) PyMem_Calloc(shared->len, sizeof(_PyXIData_t *));
658658
if (shared->items == NULL) {
659659
PyErr_NoMemory();
660+
PyMem_RawFree(shared);
660661
return -1;
661662
}
662663

0 commit comments

Comments
 (0)