diff options
author | 2009-06-05 17:20:31 +0000 | |
---|---|---|
committer | 2009-06-05 17:20:31 +0000 | |
commit | 4e2fcec202e7ff2fc4084530a2a36121aecd8f9a (patch) | |
tree | aa62c8309fa09878bcb798af0b424355d9e5f06f | |
parent | improve yp_bind(3) error reporting after clnttcp_create(3) failure: (diff) | |
download | wireguard-openbsd-4e2fcec202e7ff2fc4084530a2a36121aecd8f9a.tar.xz wireguard-openbsd-4e2fcec202e7ff2fc4084530a2a36121aecd8f9a.zip |
malloc(3) failure should raise YPERR_RESRC, not YPERR_YPERR;
ok millert@
-rw-r--r-- | lib/libc/yp/ypmatch_cache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/yp/ypmatch_cache.c b/lib/libc/yp/ypmatch_cache.c index 2c0df63e7cc..09318653d9c 100644 --- a/lib/libc/yp/ypmatch_cache.c +++ b/lib/libc/yp/ypmatch_cache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypmatch_cache.c,v 1.12 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: ypmatch_cache.c,v 1.13 2009/06/05 17:20:31 schwarze Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com> * All rights reserved. @@ -171,7 +171,7 @@ again: *outvallen = yprv.val.valdat_len; if ((*outval = malloc(*outvallen + 1)) == NULL) { _yp_unbind(ysd); - return YPERR_YPERR; + return YPERR_RESRC; } (void)memcpy(*outval, yprv.val.valdat_val, *outvallen); (*outval)[*outvallen] = '\0'; @@ -201,7 +201,7 @@ again: if (!(r = ypprot_err(yprv.stat))) { *outvallen = yprv.val.valdat_len; if ((*outval = malloc(*outvallen + 1)) == NULL) { - r = YPERR_YPERR; + r = YPERR_RESRC; goto out; } (void)memcpy(*outval, yprv.val.valdat_val, *outvallen); |