diff --git a/libc/runtime/zipos-open.c b/libc/runtime/zipos-open.c index 83b71ed76..d3bb03555 100644 --- a/libc/runtime/zipos-open.c +++ b/libc/runtime/zipos-open.c @@ -114,7 +114,6 @@ StartOver: while ((h = *ph)) { if (h->mapsize >= mapsize) { if (!_cmpxchg(ph, h, h->next)) goto StartOver; - atomic_store_explicit(&h->refs, 0, memory_order_relaxed); break; } ph = &h->next; @@ -130,6 +129,7 @@ StartOver: kAsanHeapOverrun); } if (h) { + atomic_store_explicit(&h->refs, 0, memory_order_relaxed); h->size = size; h->zipos = zipos; h->mapsize = mapsize;