Skip to content

Commit

Permalink
gh-83004: Clean up refleak in _zoneinfo initialisation (#98842)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Nov 6, 2022
1 parent 99e2e60 commit 31f2f65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
@@ -0,0 +1 @@
Clean up refleak on failed module initialisation in :mod:`_zoneinfo`
5 changes: 3 additions & 2 deletions Modules/_zoneinfo.c
Expand Up @@ -2657,8 +2657,9 @@ zoneinfomodule_exec(PyObject *m)
goto error;
}

Py_INCREF(&PyZoneInfo_ZoneInfoType);
PyModule_AddObject(m, "ZoneInfo", (PyObject *)&PyZoneInfo_ZoneInfoType);
if (PyModule_AddObjectRef(m, "ZoneInfo", (PyObject *)&PyZoneInfo_ZoneInfoType) < 0) {
goto error;
}

/* Populate imports */
_tzpath_find_tzfile =
Expand Down

0 comments on commit 31f2f65

Please sign in to comment.