From: Benjamin Peterson Date: Tue, 8 Sep 2009 23:04:22 +0000 (+0000) Subject: #6865 fix ref counting in initialization of pwd module X-Git-Tag: v2.7a1~565 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f6d0834f987f1f1599347131de4f5e9e8cb4864;p=thirdparty%2FPython%2Fcpython.git #6865 fix ref counting in initialization of pwd module --- diff --git a/Misc/NEWS b/Misc/NEWS index 3c1c54e41151..5b167460613a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1303,6 +1303,9 @@ C-API Extension Modules ----------------- +- Issue #6865: Fix reference counting issue in the initialization of the pwd + module. + - Issue #6848: Fix curses module build failure on OS X 10.6. - Fix a segfault in expat when given a specially crafted input lead to the diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index a271c5a82ebc..2865dc6bf41f 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -194,6 +194,7 @@ initpwd(void) Py_INCREF((PyObject *) &StructPwdType); PyModule_AddObject(m, "struct_passwd", (PyObject *) &StructPwdType); /* And for b/w compatibility (this was defined by mistake): */ + Py_INCREF((PyObject *) &StructPwdType); PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType); initialized = 1; }