mirror of https://github.com/python/cpython
bpo-46606: Remove redundant +1. (GH-31561)
This commit is contained in:
parent
7d03c8be5a
commit
ad6c7003e3
|
@ -8186,7 +8186,7 @@ os_setgroups(PyObject *module, PyObject *groups)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
gid_t *grouplist = PyMem_New(gid_t, len+1); // Avoid malloc(0)
|
||||
gid_t *grouplist = PyMem_New(gid_t, len);
|
||||
for (Py_ssize_t i = 0; i < len; i++) {
|
||||
PyObject *elem;
|
||||
elem = PySequence_GetItem(groups, i);
|
||||
|
|
Loading…
Reference in New Issue