Skip to content

Commit fa8434b

Browse files
committed
Handle no memory case
1 parent 47534f3 commit fa8434b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Modules/gcmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,12 @@ invoke_gc_callback(PyThreadState *tstate, const char *phase,
13901390
}
13911391

13921392
PyObject *phase_obj = PyUnicode_FromString(phase);
1393+
if (phase_obj == NULL) {
1394+
Py_XDECREF(info);
1395+
PyErr_WriteUnraisable(NULL);
1396+
return;
1397+
}
1398+
13931399
PyObject *stack[] = {phase_obj, info};
13941400
for (Py_ssize_t i=0; i<PyList_GET_SIZE(gcstate->callbacks); i++) {
13951401
PyObject *r, *cb = PyList_GET_ITEM(gcstate->callbacks, i);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy