aboutsummaryrefslogtreecommitdiff
path: root/nis/nss_nisplus/nisplus-alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nisplus/nisplus-alias.c')
-rw-r--r--nis/nss_nisplus/nisplus-alias.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
index d7926e1566..86ea5d7a1e 100644
--- a/nis/nss_nisplus/nisplus-alias.c
+++ b/nis/nss_nisplus/nisplus-alias.c
@@ -304,10 +304,18 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
}
if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
- return niserr2nss (result->status);
+ {
+ enum nss_status status = niserr2nss (result->status);
+ nis_freeresult (result);
+ return status;
+ }
parse_res = _nss_nisplus_parse_aliasent (result, 0, alias,
buffer, buflen, errnop);
+
+ /* We do not need the lookup result anymore. */
+ nis_freeresult (result);
+
if (__builtin_expect (parse_res < 1, 0))
{
__set_errno (olderr);