summaryrefslogtreecommitdiffstats
path: root/Python/frame.c
diff options
context:
space:
mode:
authorPablo Galindo <pablogsal@gmail.com>2022-02-03 22:56:59 (GMT)
committerPablo Galindo <pablogsal@gmail.com>2022-02-03 22:56:59 (GMT)
commitbd8b05395ad8877f4a065562444e117b1650c022 (patch)
tree62635cab257bf3217e660d2f0a6d52b9c96df8b5 /Python/frame.c
parent276f38f0a237aa26337a8c0e7633488e2e89d722 (diff)
parentd1df81a730499cc6286d02afa6028a1e9c22bbbf (diff)
downloadcpython-bd8b05395ad8877f4a065562444e117b1650c022.zip
cpython-bd8b05395ad8877f4a065562444e117b1650c022.tar.gz
cpython-bd8b05395ad8877f4a065562444e117b1650c022.tar.bz2
Merge remote-tracking branch 'upstream/main'
Diffstat (limited to 'Python/frame.c')
-rw-r--r--Python/frame.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/frame.c b/Python/frame.c
index ca7c5f9..76697cf 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -109,6 +109,7 @@ _PyFrame_Clear(InterpreterFrame *frame)
Py_DECREF(frame->f_code);
}
+/* Consumes reference to func */
InterpreterFrame *
_PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func)
{
@@ -117,6 +118,7 @@ _PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func)
CALL_STAT_INC(frames_pushed);
InterpreterFrame *new_frame = _PyThreadState_BumpFramePointer(tstate, size);
if (new_frame == NULL) {
+ Py_DECREF(func);
return NULL;
}
_PyFrame_InitializeSpecials(new_frame, func, NULL, code->co_nlocalsplus);