about summary refs log tree commit diff
diff options
context:
space:
mode:
-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;
 }