8000 bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827) · arun-mani-j/cpython@116826b · GitHub
[go: up one dir, main page]

Skip to content

Commit 116826b

Browse files
tiranarun-mani-j
authored andcommitted
bpo-40957: Fix refleak in _Py_fopen_obj() (pythonGH-20827)
Signed-off-by: Christian Heimes <christian@python.org>
1 parent fff93cf commit 116826b

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