]> granicus.if.org Git - python/commitdiff
#6865 fix ref counting in initialization of pwd module
authorBenjamin Peterson <benjamin@python.org>
Tue, 8 Sep 2009 23:04:22 +0000 (23:04 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 8 Sep 2009 23:04:22 +0000 (23:04 +0000)
Misc/NEWS
Modules/pwdmodule.c

index 3c1c54e41151c463017752ed918b80ffd46b4e91..5b167460613a2df8b6929e4cecd2b2e3efa00bd0 100644 (file)
--- 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
index a271c5a82ebc5267f566bb6c161963afebc0ef10..2865dc6bf41fb2d8f480dfd292ad8c2559293f5b 100644 (file)
@@ -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;
 }