Page MenuHomeFreeBSD

D52580.id162256.diff
No OneTemporary

D52580.id162256.diff

diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -31,11 +31,7 @@
#include <sys/param.h>
-#include "namespace.h"
-#include <err.h>
-#include "un-namespace.h"
#include <errno.h>
-#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -51,12 +47,13 @@
* setgroups to fail and set errno.
*/
ngroups_max = sysconf(_SC_NGROUPS_MAX) + 2;
- if ((groups = malloc(sizeof(*groups) * ngroups_max)) == NULL)
- return (ENOMEM);
+ groups = malloc(sizeof(*groups) * ngroups_max);
+ if (groups == NULL)
+ return (-1); /* malloc() set 'errno'. */
ngroups = (int)ngroups_max;
getgrouplist(uname, agroup, groups, &ngroups);
ret = setgroups(ngroups, groups);
free(groups);
- return (ret);
+ return (ret); /* setgroups() set 'errno'. */
}

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 12, 5:31 AM (15 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27617847
Default Alt Text
D52580.id162256.diff (841 B)

Event Timeline