Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a925498

Browse filesBrowse files
committed
fix refleak of exit when __enter__ raises
1 parent 0a5f78d commit a925498
Copy full SHA for a925498

File tree

2 files changed

+8
-2
lines changed
Filter options

2 files changed

+8
-2
lines changed

‎Python/bytecodes.c

Copy file name to clipboardExpand all lines: Python/bytecodes.c
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2331,7 +2331,10 @@ dummy_func(
23312331
DECREF_INPUTS();
23322332
res = _PyObject_CallNoArgs(enter);
23332333
Py_DECREF(enter);
2334-
ERROR_IF(res == NULL, error);
2334+
if (res == NULL) {
2335+
Py_DECREF(exit);
2336+
ERROR_IF(true, error);
2337+
}
23352338
}
23362339

23372340
inst(WITH_EXCEPT_START, (exit_func, lasti, unused, val -- exit_func, lasti, unused, val, res)) {

‎Python/generated_cases.c.h

Copy file name to clipboardExpand all lines: Python/generated_cases.c.h
+4-1Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.