gh-157015: Fix double-decref in PyContext_Exit() by AZero13 · Pull Request #157016 · python/cpython · GitHub
Skip to content

gh-157015: Fix double-decref in PyContext_Exit() - #157016

Closed
AZero13 wants to merge 1 commit into
python:mainfrom
AZero13:double-ref
Closed

gh-157015: Fix double-decref in PyContext_Exit()#157016
AZero13 wants to merge 1 commit into
python:mainfrom
AZero13:double-ref

Conversation

@AZero13

@AZero13 AZero13 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

There was a double-decref bug in _PyContext_Exit() in Python/context.c. The function was calling Py_SETREF(ts->context, (PyObject *)ctx->ctx_prev) before clearing the ctx->ctx_prev and ctx->ctx_entered internal states.

There was a double-decref bug in _PyContext_Exit() in Python/context.c. The function was calling Py_SETREF(ts->context, (PyObject *)ctx->ctx_prev) before clearing the ctx->ctx_prev and ctx->ctx_entered internal states.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants