From: Eric Snow Date: Fri, 9 Dec 2022 17:18:29 +0000 (-0700) Subject: gh-81057: Fix a Reference Leak in the posix Module (gh-100140) X-Git-Tag: v3.12.0a4~246 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a0f3c1d92ef0768e082ace19d970b0ef12e7346;p=thirdparty%2FPython%2Fcpython.git gh-81057: Fix a Reference Leak in the posix Module (gh-100140) The leak was introduced in gh-100082. https://github.com/python/cpython/issues/81057 --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index f5175350e12a..4817973262f4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2242,6 +2242,7 @@ statresult_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } _posixstate *state = get_posix_state(mod); + Py_DECREF(mod); if (state == NULL) { return NULL; }