From ad6c7003e38a9f8bdf8d865fb5fa0f3c03690315 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 25 Feb 2022 14:13:14 +0900 Subject: [PATCH] bpo-46606: Remove redundant +1. (GH-31561) --- Modules/posixmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 5e942c43dd6..d3cfc828184 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);