]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-145376: Fix refleak in error path of time_tzset (GH-145477)
authorPieter Eendebak <pieter.eendebak@gmail.com>
Wed, 4 Mar 2026 13:21:10 +0000 (14:21 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Mar 2026 13:21:10 +0000 (14:21 +0100)
Modules/timemodule.c

index 3946d18479e253bfd4e75c061d63f0fc5bc96f8b..a3260e0f15ab9948b0aca09b29f0a06dca5f97c4 100644 (file)
@@ -1170,7 +1170,8 @@ time_tzset(PyObject *self, PyObject *unused)
 
     /* Reset timezone, altzone, daylight and tzname */
     if (init_timezone(m) < 0) {
-         return NULL;
+        Py_DECREF(m);
+        return NULL;
     }
     Py_DECREF(m);
     if (PyErr_Occurred())