#6865 fix ref counting in initialization of pwd module

This commit is contained in:
Benjamin Peterson 2009-09-08 23:04:22 +00:00
parent 5cfa8044ff
commit 7f6d0834f9
2 changed files with 4 additions and 0 deletions

View File

@ -1303,6 +1303,9 @@ C-API
Extension Modules 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. - 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 - Fix a segfault in expat when given a specially crafted input lead to the

View File

@ -194,6 +194,7 @@ initpwd(void)
Py_INCREF((PyObject *) &StructPwdType); Py_INCREF((PyObject *) &StructPwdType);
PyModule_AddObject(m, "struct_passwd", (PyObject *) &StructPwdType); PyModule_AddObject(m, "struct_passwd", (PyObject *) &StructPwdType);
/* And for b/w compatibility (this was defined by mistake): */ /* And for b/w compatibility (this was defined by mistake): */
Py_INCREF((PyObject *) &StructPwdType);
PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType); PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType);
initialized = 1; initialized = 1;
} }