mirror of
https://github.com/python/cpython.git
synced 2026-06-28 03:41:13 +00:00
[3.15] gh-151842: Fix crash upon OOM in _interpreters.capture_exception (GH-151843) (GH-152031)
(cherry picked from commit 5e0747db2f)
Co-authored-by: Amrutha <amruthamodela06@gmail.com>
This commit is contained in:
parent
bd39eea0db
commit
415e218ed5
3 changed files with 7 additions and 1 deletions
|
|
@ -1689,6 +1689,7 @@ _PyXI_NewExcInfo(PyObject *exc)
|
|||
}
|
||||
_PyXI_excinfo *info = PyMem_RawCalloc(1, sizeof(_PyXI_excinfo));
|
||||
if (info == NULL) {
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
const char *failure;
|
||||
|
|
@ -1709,6 +1710,7 @@ _PyXI_NewExcInfo(PyObject *exc)
|
|||
void
|
||||
_PyXI_FreeExcInfo(_PyXI_excinfo *info)
|
||||
{
|
||||
assert(info != NULL);
|
||||
_PyXI_excinfo_clear(info);
|
||||
PyMem_RawFree(info);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue