Skip to content

Commit 3fe7849

Browse files
authored
gh-145376: Fix refleak in error path of time_tzset (GH-145477)
1 parent 45e9343 commit 3fe7849

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/timemodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,8 @@ time_tzset(PyObject *self, PyObject *unused)
11701170

11711171
/* Reset timezone, altzone, daylight and tzname */
11721172
if (init_timezone(m) < 0) {
1173-
return NULL;
1173+
Py_DECREF(m);
1174+
return NULL;
11741175
}
11751176
Py_DECREF(m);
11761177
if (PyErr_Occurred())

0 commit comments

Comments
 (0)