diff options
Diffstat (limited to 'nis/nss_nisplus/nisplus-alias.c')
-rw-r--r-- | nis/nss_nisplus/nisplus-alias.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c index 0a16b38..8d682d7 100644 --- a/nis/nss_nisplus/nisplus-alias.c +++ b/nis/nss_nisplus/nisplus-alias.c @@ -24,7 +24,6 @@ #include <aliases.h> #include <bits/libc-lock.h> #include <rpcsvc/nis.h> -#include <rpcsvc/nislib.h> #include "nss-nisplus.h" @@ -153,6 +152,8 @@ _nss_nisplus_parse_aliasent (nis_result *result, unsigned long entry, static enum nss_status internal_setaliasent (void) { + enum nss_status status; + if (result) nis_freeresult (result); result = NULL; @@ -162,12 +163,13 @@ internal_setaliasent (void) next_entry = 0; result = nis_list(tablename_val, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL); - if (niserr2nss (result->status) != NSS_STATUS_SUCCESS) + status = niserr2nss (result->status); + if (status != NSS_STATUS_SUCCESS) { nis_freeresult (result); result = NULL; } - return niserr2nss (result->status); + return status; } enum nss_status @@ -206,7 +208,13 @@ internal_nisplus_getaliasent_r (struct aliasent *alias, int parse_res; if (result == NULL) - internal_setaliasent (); + { + enum nss_status status; + + status = internal_setaliasent (); + if (result == NULL || status != NSS_STATUS_SUCCESS) + return status; + } /* Get the next entry until we found a correct one. */ do |