summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/posixmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 5e942c4..d3cfc82 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -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);