diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-06-13 16:15:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-13 16:15:05 (GMT) |
commit | a8936fa5c09c039ad457dda8bdf733be6cc182e3 (patch) | |
tree | 5ef51b788d468dbdd1ca58648b6aba4a9106dc42 /Python | |
parent | 26db10a431bf5b55340f4427bf015719e384d306 (diff) | |
download | cpython-a8936fa5c09c039ad457dda8bdf733be6cc182e3.zip cpython-a8936fa5c09c039ad457dda8bdf733be6cc182e3.tar.gz cpython-a8936fa5c09c039ad457dda8bdf733be6cc182e3.tar.bz2 |
bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9672912e8f90374fd31b37ca0fb7cefbc6f4c555)
Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/fileutils.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c index e79e732..1021ddb 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1461,6 +1461,7 @@ _Py_fopen_obj(PyObject *path, const char *mode) path_bytes = PyBytes_AS_STRING(bytes); if (PySys_Audit("open", "Osi", path, mode, 0) < 0) { + Py_DECREF(bytes); return NULL; } |