about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-04-08 19:35:24 +0000
committerUlrich Drepper <drepper@redhat.com>2006-04-08 19:35:24 +0000
commitdb67c2c98b89a5723af44df54f38b779de8d4a65 (patch)
tree8f0c926942134212e714d221e284f12cc59c1275
parent8b7600e8cf56d5409c5733ffee77838ca7aa4428 (diff)
downloadglibc-db67c2c98b89a5723af44df54f38b779de8d4a65.tar.gz
glibc-db67c2c98b89a5723af44df54f38b779de8d4a65.tar.xz
glibc-db67c2c98b89a5723af44df54f38b779de8d4a65.zip
* io/fts.c (fts_build): Call fts_lfree in the two error cases
	after the loop [Coverity CID 187].

	* nis/nis_getservlist.c (nis_getservlist): Also free lookup result
	in error case [Coverity CID 189].

	* nis/nis_getservlist.c (nis_getservlist): One more free call
	needed [Coverity CID 190].
-rw-r--r--ChangeLog11
-rw-r--r--io/fts.c2
-rw-r--r--nis/nis_getservlist.c7
3 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c72a94fc4..ed170f494a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-04-08  Ulrich Drepper  <drepper@redhat.com>
+
+	* io/fts.c (fts_build): Call fts_lfree in the two error cases
+	after the loop [Coverity CID 187].
+
+	* nis/nis_getservlist.c (nis_getservlist): Also free lookup result
+	in error case [Coverity CID 189].
+
+	* nis/nis_getservlist.c (nis_getservlist): One more free call
+	needed [Coverity CID 190].
+
 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
 
 	* sysdeps/generic/unwind-dw2-fde.c (end_fde_sort): Remove
diff --git a/io/fts.c b/io/fts.c
index 71400d1716..6383fe8f17 100644
--- a/io/fts.c
+++ b/io/fts.c
@@ -828,6 +828,7 @@ mem1:				saved_errno = errno;
 	     fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
 		cur->fts_info = FTS_ERR;
 		SET(FTS_STOP);
+		fts_lfree(head);
 		return (NULL);
 	}
 
@@ -835,6 +836,7 @@ mem1:				saved_errno = errno;
 	if (!nitems) {
 		if (type == BREAD)
 			cur->fts_info = FTS_DP;
+		fts_lfree(head);
 		return (NULL);
 	}
 
diff --git a/nis/nis_getservlist.c b/nis/nis_getservlist.c
index bea9d4dbc0..e57649d526 100644
--- a/nis/nis_getservlist.c
+++ b/nis/nis_getservlist.c
@@ -72,6 +72,10 @@ nis_getservlist (const_nis_name dir)
 		  free (serv[i]);
 		}
 
+	      free (serv);
+
+	      nis_freeresult (res);
+
 	      return NULL;
 	    }
 
@@ -141,8 +145,7 @@ nis_getservlist (const_nis_name dir)
 	serv[0] = NULL;
     }
 
-  if (res != NULL)
-    nis_freeresult (res);
+  nis_freeresult (res);
 
   return serv;
 }