about summary refs log tree commit diff
path: root/elf/dl-libc.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-libc.c')
-rw-r--r--elf/dl-libc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/elf/dl-libc.c b/elf/dl-libc.c
index 7d2b3608b2..dc47851803 100644
--- a/elf/dl-libc.c
+++ b/elf/dl-libc.c
@@ -126,6 +126,16 @@ static void
 free_mem (void)
 {
   struct link_map *l;
+  struct r_search_path_elem *d;
+
+  /* Remove all search directories.  */
+  d = _dl_all_dirs;
+  while (d != _dl_init_all_dirs)
+    {
+      struct r_search_path_elem *old = d;
+      d = d->next;
+      free (old);
+    }
 
   /* Remove all additional names added to the objects.  */
   for (l = _dl_loaded; l != NULL; l = l->l_next)