Commit e23c8683 authored by Martin v. Löwis's avatar Martin v. Löwis

Merged revisions 73016 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73016 | martin.v.loewis | 2009-05-29 17:58:08 +0200 (Fr, 29 Mai 2009) | 2 lines

  Issue #4873: Fix resource leaks in error cases of pwd and grp.
........
parent b6a748b8
...@@ -108,6 +108,8 @@ Installation ...@@ -108,6 +108,8 @@ Installation
Extension Modules Extension Modules
----------------- -----------------
- Issue #4873: Fix resource leaks in error cases of pwd and grp.
- Issue #6093: Fix off-by-one error in locale.strxfrm. - Issue #6093: Fix off-by-one error in locale.strxfrm.
- The _functools and _locale modules are now built into the libpython shared - The _functools and _locale modules are now built into the libpython shared
......
...@@ -79,7 +79,6 @@ mkgrent(struct group *p) ...@@ -79,7 +79,6 @@ mkgrent(struct group *p)
if (PyErr_Occurred()) { if (PyErr_Occurred()) {
Py_DECREF(v); Py_DECREF(v);
Py_DECREF(w);
return NULL; return NULL;
} }
...@@ -145,6 +144,7 @@ grp_getgrall(PyObject *self, PyObject *ignore) ...@@ -145,6 +144,7 @@ grp_getgrall(PyObject *self, PyObject *ignore)
if (v == NULL || PyList_Append(d, v) != 0) { if (v == NULL || PyList_Append(d, v) != 0) {
Py_XDECREF(v); Py_XDECREF(v);
Py_DECREF(d); Py_DECREF(d);
endgrent();
return NULL; return NULL;
} }
Py_DECREF(v); Py_DECREF(v);
......
...@@ -175,6 +175,7 @@ pwd_getpwall(PyObject *self) ...@@ -175,6 +175,7 @@ pwd_getpwall(PyObject *self)
if (v == NULL || PyList_Append(d, v) != 0) { if (v == NULL || PyList_Append(d, v) != 0) {
Py_XDECREF(v); Py_XDECREF(v);
Py_DECREF(d); Py_DECREF(d);
endpwent();
return NULL; return NULL;
} }
Py_DECREF(v); Py_DECREF(v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment