aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-close.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 65992d5c80..9d81ad3db8 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -386,7 +386,11 @@ free_slotinfo (struct dtv_slotinfo_list *elemp)
{
size_t cnt;
- if (elemp->next != NULL && !free_slotinfo (elemp->next))
+ if (elemp == NULL)
+ /* Nothing here, all is removed (or there never was anything). */
+ return true;
+
+ if (!free_slotinfo (elemp->next))
/* We cannot free the entry. */
return false;