(internal_nis_getpwent_r): Don't try to free outkey in error case when
authordrepper <drepper>
Mon, 1 May 2006 22:31:15 +0000 (22:31 +0000)
committerdrepper <drepper>
Mon, 1 May 2006 22:31:15 +0000 (22:31 +0000)
batch_read is set.

nis/nss_nis/nis-pwd.c

index 7972118..1b5206a 100644 (file)
@@ -333,7 +333,8 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
                                          errnop);
       if (__builtin_expect (parse_res == -1, 0))
        {
-         free (outkey);
+         if (!batch_read)
+           free (outkey);
          *errnop = ERANGE;
          return NSS_STATUS_TRYAGAIN;
        }