Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
	(getgrouplist): Simplify code a bit.  Don't allocate one additional
	element on NEWGROUPS.
  • Loading branch information
Ulrich Drepper committed Aug 3, 2006
1 parent 6c215a8 commit 39571a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
2006-08-03 Ulrich Drepper <drepper@redhat.com>


* grp/initgroups.c (internal_getgrouplist): Remove unnecessary
test introduced in patch for bz #661.
(getgrouplist): Simplify code a bit.
(getgrouplist): Simplify code a bit. Don't allocate one additional
element on NEWGROUPS.

[BZ #2908]
* stdio-common/printf_fphex.c (__printf_fphex): When rounding up
Expand Down
2 changes: 1 addition & 1 deletion grp/initgroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups)
{
long int size = MAX (1, *ngroups);

gid_t *newgroups = (gid_t *) malloc ((size + 1) * sizeof (gid_t));
gid_t *newgroups = (gid_t *) malloc (size * sizeof (gid_t));
if (__builtin_expect (newgroups == NULL, 0))
/* No more memory. */
// XXX This is wrong. The user provided memory, we have to use
Expand Down

0 comments on commit 39571a1

Please sign in to comment.