diff --git a/compiler-rt/lib/lsan/lsan_allocator.cpp b/compiler-rt/lib/lsan/lsan_allocator.cpp --- a/compiler-rt/lib/lsan/lsan_allocator.cpp +++ b/compiler-rt/lib/lsan/lsan_allocator.cpp @@ -375,6 +375,7 @@ if (beg == nullptr) return 0; ChunkMetadata *m = Metadata(beg); if (m == nullptr) return 0; + if (!m->allocated) return 0; if (m->requested_size == 0) return 0; *start = (void*)beg; *size = m->requested_size;