aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/dl-tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/dl-tls.c')
-rw-r--r--sysdeps/generic/dl-tls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c
index fe8f791638..a6428652cf 100644
--- a/sysdeps/generic/dl-tls.c
+++ b/sysdeps/generic/dl-tls.c
@@ -500,7 +500,10 @@ __tls_get_addr (GET_ADDR_ARGS)
/* If this modid was used at some point the memory
might still be allocated. */
if (dtv[total + cnt].pointer != TLS_DTV_UNALLOCATED)
- free (dtv[total + cnt].pointer);
+ {
+ free (dtv[total + cnt].pointer);
+ dtv[total + cnt].pointer = TLS_DTV_UNALLOCATED;
+ }
continue;
}