Skip to content

Commit 1393a02

Browse files
committed
early return for un-initialized heap
1 parent 850edce commit 1393a02

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tlsf.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ impl Heap {
112112

113113
fn free_with_cs(&self, cs: critical_section::CriticalSection) -> usize {
114114
let inner_mut = self.heap.borrow_ref_mut(cs);
115+
if !inner_mut.initialized {
116+
return 0;
117+
}
115118
unsafe {
116119
inner_mut
117120
.tlsf

0 commit comments

Comments
 (0)