Unverified Commit 04bed15a by 2xsec Committed by Christian Brauner

coverity: #1437017

Uninitialized pointer Signed-off-by: 's avatar2xsec <dh48.jeong@samsung.com>
parent 21944ce5
......@@ -191,6 +191,8 @@ static char **get_groupnames(void)
return NULL;
}
memset(groupnames, 0, sizeof(char *) * (ngroups + 1));
bufsize = sysconf(_SC_GETGR_R_SIZE_MAX);
if (bufsize == -1)
bufsize = 1024;
......@@ -205,8 +207,6 @@ static char **get_groupnames(void)
return NULL;
}
memset(groupnames, 0, sizeof(char *) * (ngroups + 1));
for (i = 0; i < ngroups; i++) {
ret = getgrgid_r(group_ids[i], &grent, buf, bufsize, &grentp);
if (!grentp) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment