aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/cxa_thread_atexit_impl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/cxa_thread_atexit_impl.c b/lib/libc/stdlib/cxa_thread_atexit_impl.c
index 3123bd12dca8..3d742d90fb44 100644
--- a/lib/libc/stdlib/cxa_thread_atexit_impl.c
+++ b/lib/libc/stdlib/cxa_thread_atexit_impl.c
@@ -119,9 +119,9 @@ walk_cb_nocall(struct cxa_thread_dtor *dtor __unused)
static void
cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *))
{
- struct cxa_thread_dtor *dtor, *tdtor;
+ struct cxa_thread_dtor *dtor;
- LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) {
+ while ((dtor = LIST_FIRST(&dtors)) != NULL) {
LIST_REMOVE(dtor, entry);
cb(dtor);
free(dtor);