mirror of
https://github.com/python/cpython.git
synced 2026-06-28 22:00:19 -04: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:
committed by
GitHub
parent
bd39eea0db
commit
415e218ed5
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user