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>
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 439bc35..22e72bd 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -1461,6 +1461,7 @@
     path_bytes = PyBytes_AS_STRING(bytes);
 
     if (PySys_Audit("open", "Osi", path, mode, 0) < 0) {
+        Py_DECREF(bytes);
         return NULL;
     }