mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
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. ........
This commit is contained in:
parent
ba130b825d
commit
416b262343
3 changed files with 7 additions and 1 deletions
|
@ -108,6 +108,11 @@ Library
|
||||||
makeunicodedata.py and regenerated the Unicode database (This fixes
|
makeunicodedata.py and regenerated the Unicode database (This fixes
|
||||||
u'\u1d79'.lower() == '\x00').
|
u'\u1d79'.lower() == '\x00').
|
||||||
|
|
||||||
|
Extension Modules
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
- Issue #4873: Fix resource leaks in error cases of pwd and grp.
|
||||||
|
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,6 @@ mkgrent(struct group *p)
|
||||||
|
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
Py_DECREF(v);
|
Py_DECREF(v);
|
||||||
Py_DECREF(w);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +138,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);
|
||||||
|
|
|
@ -160,6 +160,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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue