about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-01 23:08:36 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-01 23:08:36 +0000
commit4ce636da6cf71061410da841e12b27b5f551e879 (patch)
tree7fbf79a1e87740f20182aacd009e4d1ca8480140
parentfc3597c0f80a4a7d7c0425285bdefa6f5fff87da (diff)
downloadglibc-4ce636da6cf71061410da841e12b27b5f551e879.tar.gz
glibc-4ce636da6cf71061410da841e12b27b5f551e879.tar.xz
glibc-4ce636da6cf71061410da841e12b27b5f551e879.zip
Update.
	* elf/dl-close.c (_dl_close): Add more comments and correct some.
	Free l_searchlist and l_dupsearchlist.
-rw-r--r--ChangeLog3
-rw-r--r--elf/dl-close.c18
2 files changed, 18 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ee4884d3f3..517f272841 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1998-09-01  Ulrich Drepper  <drepper@cygnus.com>
 
+	* elf/dl-close.c (_dl_close): Add more comments and correct some.
+	Free l_searchlist and l_dupsearchlist.
+
 	* debug/catchsegv.sh: Add one more pair of quotes.
 
 1998-09-01 17:53  Ulrich Drepper  <drepper@cygnus.com>
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 94978ed961..3b1e3c9f57 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -116,8 +116,8 @@ _dl_close (struct link_map *map)
 	    }
 
 	  /* We can unmap all the maps at once.  We determined the
-	     length when we loaded the object and `munmap' call does
-	     the rest.  */
+	     start address and length when we loaded the object and
+	     the `munmap' call does the rest.  */
 	  __munmap ((void *) imap->l_map_start,
 		    imap->l_map_end - imap->l_map_start);
 
@@ -143,8 +143,9 @@ _dl_close (struct link_map *map)
 	  if (imap->l_origin != NULL)
 	    free ((char *) imap->l_origin);
 
-	  /* These names always is allocated.  */
+	  /* This name always is allocated.  */
 	  free (imap->l_name);
+	  /* Remove the list with all the names of the shared object.  */
 	  lnp = imap->l_libname;
 	  do
 	    {
@@ -154,6 +155,17 @@ _dl_close (struct link_map *map)
 	    }
 	  while (lnp != NULL);
 
+	  /* Remove the searchlists.  */
+	  if (imap->l_dupsearchlist != imap->l_searchlist)
+	    {
+	      /* If a l_searchlist object exists there always also is
+		 a l_dupsearchlist object.  */
+	      assert (imap->l_dupsearchlist != NULL);
+	      free (imap->l_dupsearchlist);
+	    }
+	  if (imap != map && imap->l_searchlist != NULL)
+	    free (imap->l_searchlist);
+
 	  free (imap);
 	}
     }