summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2022-02-25 05:13:14 (GMT)
committerGitHub <noreply@github.com>2022-02-25 05:13:14 (GMT)
commitad6c7003e38a9f8bdf8d865fb5fa0f3c03690315 (patch)
tree99fd74b4c6920e78b93af64ee35f70730b6b68d6 /Modules/posixmodule.c
parent7d03c8be5af2f1559dbc35b775b3116dfd63cfb6 (diff)
downloadcpython-ad6c7003e38a9f8bdf8d865fb5fa0f3c03690315.zip
cpython-ad6c7003e38a9f8bdf8d865fb5fa0f3c03690315.tar.gz
cpython-ad6c7003e38a9f8bdf8d865fb5fa0f3c03690315.tar.bz2
bpo-46606: Remove redundant +1. (GH-31561)
Diffstat (limited to 'Modules/posixmodule.c')
-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);