Skip to content

Commit b7b35f4

Browse files
committed
Add a message to an assertion that often fails on double free
1 parent aed64cc commit b7b35f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hole.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ fn deallocate(mut hole: &mut Hole, addr: usize, mut size: usize) {
225225

226226
// Each freed block must be handled by the previous hole in memory. Thus the freed
227227
// address must be always behind the current hole.
228-
assert!(hole_addr + hole.size <= addr);
228+
assert!(hole_addr + hole.size <= addr,
229+
"invalid deallocation (probably a double free)");
229230

230231
// get information about the next block
231232
let next_hole_info = hole.next.as_ref().map(|next| unsafe { next.get().info() });

0 commit comments

Comments
 (0)