mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Update.
2000-04-21 Ulrich Drepper <drepper@redhat.com> * iconv/iconv.c (iconv): Add __builtin_expect where useful. * iconv/iconv_close.c (iconv_close): Likewise. * iconv/iconv_open.c (iconv_open): Likewise. * grp/putgrent.c (putgrent): Unlock steam if fprintf failed. Add __builtin_expect where useful. * grp/initgroups.c (initgroups): Test for result of memory allocation and punt if it fails. * dirent/scandir.c (scandir): Add __builtin_expect where useful. * grp/fgetgrent.c (fgetfrent): Likewise. * grp/fgetgrent_r.c (__fgetgrent_r): Likewise.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1989, 91, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 91, 93, 1996-1999, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -163,7 +163,10 @@ initgroups (user, group)
|
||||
size = 16;
|
||||
#endif
|
||||
|
||||
groups = malloc (size * sizeof (gid_t *));
|
||||
groups = (gid_t *) malloc (size * sizeof (gid_t));
|
||||
if (__builtin_expect (groups == NULL, 0))
|
||||
/* No more memory. */
|
||||
return -1;
|
||||
|
||||
groups[0] = group;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user