summaryrefslogtreecommitdiff
path: root/elf/dl-close.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r--elf/dl-close.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 184d38298e..0a16d69f0d 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -99,7 +99,8 @@ _dl_close (struct link_map *map)
}
/* Finally, unlink the data structure and free it. */
- map->l_prev->l_next = map->l_next;
+ if (map->l_prev)
+ map->l_prev->l_next = map->l_next;
if (map->l_next)
map->l_next->l_prev = map->l_prev;
if (map->l_searchlist)