summaryrefslogtreecommitdiff
path: root/nis/nis_subr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-22 03:58:39 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-22 03:58:39 +0000
commit54eb84d0c769dbd974b21ffd9d41d48aff203a15 (patch)
tree62e967244da950de59f2ebb8ed4b9958136bba71 /nis/nis_subr.c
parente88e03a0451bba8f20faadcd5f214810770824f1 (diff)
Update.
* nis/nis_findserv.c (__nis_findfastest): Improve memory handling. * nis/nis_print_group_entry.c (nis_print_group_entry): Use alloca instead of malloc. * nis/nis_subr.c: Use __builtin_expect. * nis/ypclnt.c: Likewise. * nis/nis_getservlist.c: Likewise. * nis/nis_creategroup.c: Likewise.
Diffstat (limited to 'nis/nis_subr.c')
-rw-r--r--nis/nis_subr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/nis/nis_subr.c b/nis/nis_subr.c
index c7d58a60e9..a5ddf03d51 100644
--- a/nis/nis_subr.c
+++ b/nis/nis_subr.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@@ -126,7 +126,7 @@ nis_getnames (const_nis_name name)
count = 1;
getnames = malloc ((count + 1) * sizeof (char *));
- if (getnames == NULL)
+ if (__builtin_expect (getnames == NULL, 0))
return NULL;
/* Do we have a fully qualified NIS+ name ? If yes, give it back */
@@ -165,12 +165,12 @@ nis_getnames (const_nis_name name)
{
count += 5;
getnames = realloc (getnames, (count + 1) * sizeof (char *));
- if (getnames == NULL)
+ if (__builtin_expect (getnames == NULL, 0))
return NULL;
}
tmp = malloc (strlen (cptr) + strlen (local_domain) +
strlen (name) + 2);
- if (tmp == NULL)
+ if (__builtin_expect (tmp == NULL, 0))
return NULL;
getnames[pos] = tmp;
@@ -200,7 +200,7 @@ nis_getnames (const_nis_name name)
char *p;
tmp = malloc (cplen + strlen (local_domain) + strlen (name) + 2);
- if (tmp == NULL)
+ if (__builtin_expect (tmp == NULL, 0))
return NULL;
p = __stpcpy (tmp, name);
@@ -216,7 +216,7 @@ nis_getnames (const_nis_name name)
char *p;
tmp = malloc (cplen + strlen (name) + 2);
- if (tmp == NULL)
+ if (__builtin_expect (tmp == NULL, 0))
return NULL;
p = __stpcpy (tmp, name);
@@ -228,7 +228,7 @@ nis_getnames (const_nis_name name)
{
count += 5;
getnames = realloc (getnames, (count + 1) * sizeof (char *));
- if (getnames == NULL)
+ if (__builtin_expect (getnames == NULL, 0))
return NULL;
}
getnames[pos] = tmp;