diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-12-07 10:11:30 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-07 10:11:30 (GMT) |
commit | 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9 (patch) | |
tree | aae3660f9a5bc462830107cf2311b2557898e268 /Modules/posixmodule.c | |
parent | 3a521f0b6167628f975c773b56c7daf8d33d6f40 (diff) | |
download | cpython-4c49da0cb7434c676d70b9ccf38aca82ac0d64a9.zip cpython-4c49da0cb7434c676d70b9ccf38aca82ac0d64a9.tar.gz cpython-4c49da0cb7434c676d70b9ccf38aca82ac0d64a9.tar.bz2 |
bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015)
Set MemoryError when appropriate, add missing failure checks,
and fix some potential leaks.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7571385..09d724f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6651,8 +6651,7 @@ os_getgroups_impl(PyObject *module) } else { alt_grouplist = PyMem_New(gid_t, n); if (alt_grouplist == NULL) { - errno = EINVAL; - return posix_error(); + return PyErr_NoMemory(); } } @@ -6677,8 +6676,7 @@ os_getgroups_impl(PyObject *module) } else { alt_grouplist = PyMem_New(gid_t, n); if (alt_grouplist == NULL) { - errno = EINVAL; - return posix_error(); + return PyErr_NoMemory(); } n = getgroups(n, alt_grouplist); if (n == -1) { |