about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--nis/nss_nis/nis-grp.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 549d729cc2..b5efea9dad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
 
+	* nis/nss_nis/nis-grp.c (internal_nis_getgrent_r): Don't try to
+	free outkey in error case when batch_read is set [Coverity CID 196].
+
 	[BZ #2517]
 	* misc/sys/queue.h: Update to more recent version.
 
diff --git a/nis/nss_nis/nis-grp.c b/nis/nss_nis/nis-grp.c
index ce642c484f..6e36cf828f 100644
--- a/nis/nss_nis/nis-grp.c
+++ b/nis/nss_nis/nis-grp.c
@@ -220,7 +220,8 @@ internal_nis_getgrent_r (struct group *grp, 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;
 	}