aboutsummaryrefslogtreecommitdiff
path: root/nis
diff options
context:
space:
mode:
Diffstat (limited to 'nis')
-rw-r--r--nis/nss_nis/nis-grp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nis/nss_nis/nis-grp.c b/nis/nss_nis/nis-grp.c
index 071d8a2a55..6ad30eb1bb 100644
--- a/nis/nss_nis/nis-grp.c
+++ b/nis/nss_nis/nis-grp.c
@@ -204,7 +204,8 @@ internal_nis_getgrent_r (struct group *grp, char *buffer, size_t buflen,
if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
{
- free (result);
+ if (!batch_read)
+ free (result);
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}