aboutsummaryrefslogtreecommitdiff
path: root/nis/ypclnt.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/ypclnt.c
parente88e03a0451bba8f20faadcd5f214810770824f1 (diff)
downloadglibc-54eb84d0c769dbd974b21ffd9d41d48aff203a15.zip
glibc-54eb84d0c769dbd974b21ffd9d41d48aff203a15.tar.gz
glibc-54eb84d0c769dbd974b21ffd9d41d48aff203a15.tar.bz2
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/ypclnt.c')
-rw-r--r--nis/ypclnt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/nis/ypclnt.c b/nis/ypclnt.c
index 637afcc..a62e356 100644
--- a/nis/ypclnt.c
+++ b/nis/ypclnt.c
@@ -81,7 +81,7 @@ __yp_bind (const char *domain, dom_binding **ypdb)
{
is_new = 1;
ysd = (dom_binding *) calloc (1, sizeof *ysd);
- if (ysd == NULL)
+ if (__builtin_expect (ysd == NULL, 0))
return YPERR_RESRC;
}
@@ -448,7 +448,7 @@ yp_match (const char *indomain, const char *inmap, const char *inkey,
*outvallen = resp.val.valdat_len;
*outval = malloc (*outvallen + 1);
- if (*outval == NULL)
+ if (__builtin_expect (*outval == NULL, 0))
return YPERR_RESRC;
memcpy (*outval, resp.val.valdat_val, *outvallen);
(*outval)[*outvallen] = '\0';
@@ -488,13 +488,13 @@ yp_first (const char *indomain, const char *inmap, char **outkey,
*outkeylen = resp.key.keydat_len;
*outkey = malloc (*outkeylen + 1);
- if (*outkey == NULL)
+ if (__builtin_expect (*outkey == NULL, 0))
return YPERR_RESRC;
memcpy (*outkey, resp.key.keydat_val, *outkeylen);
(*outkey)[*outkeylen] = '\0';
*outvallen = resp.val.valdat_len;
*outval = malloc (*outvallen + 1);
- if (*outval == NULL)
+ if (__builtin_expect (*outval == NULL, 0))
return YPERR_RESRC;
memcpy (*outval, resp.val.valdat_val, *outvallen);
(*outval)[*outvallen] = '\0';
@@ -538,13 +538,13 @@ yp_next (const char *indomain, const char *inmap, const char *inkey,
*outkeylen = resp.key.keydat_len;
*outkey = malloc (*outkeylen + 1);
- if (*outkey == NULL)
+ if (__builtin_expect (*outkey == NULL, 0))
return YPERR_RESRC;
memcpy (*outkey, resp.key.keydat_val, *outkeylen);
(*outkey)[*outkeylen] = '\0';
*outvallen = resp.val.valdat_len;
*outval = malloc (*outvallen + 1);
- if (*outval == NULL)
+ if (__builtin_expect (*outval == NULL, 0))
return YPERR_RESRC;
memcpy (*outval, resp.val.valdat_val, *outvallen);
(*outval)[*outvallen] = '\0';