summaryrefslogtreecommitdiff
path: root/Modules/grpmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/grpmodule.c')
-rw-r--r--Modules/grpmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c
index e5b9f4708c..ffb451e174 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -76,7 +76,6 @@ mkgrent(struct group *p)
if (PyErr_Occurred()) {
Py_DECREF(v);
- Py_DECREF(w);
return NULL;
}
@@ -139,6 +138,7 @@ grp_getgrall(PyObject *self, PyObject *ignore)
if (v == NULL || PyList_Append(d, v) != 0) {
Py_XDECREF(v);
Py_DECREF(d);
+ endgrent();
return NULL;
}
Py_DECREF(v);