8000 bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827) · python/cpython@a8936fa · GitHub
[go: up one dir, main page]

Skip to content < 8000 div data-target="react-partial.reactRoot">

Commit a8936fa

Browse files
bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)
Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 9672912) Co-authored-by: Christian Heimes <christian@python.org>
1 parent 26db10a commit a8936fa

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix refleak in _Py_fopen_obj() when PySys_Audit() fails

Python/fileutils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,7 @@ _Py_fopen_obj(PyObject *path, const char *mode)
14611461
path_bytes = PyBytes_AS_STRING(bytes);
14621462

14631463
if (PySys_Audit("open", "Osi", path, mode, 0) < 0) {
1464+
Py_DECREF(bytes);
14641465
return NULL;
14651466
}
14661467

0 commit comments

Comments
 (0)
0