diff --git a/src/lib.rs b/src/lib.rs index 7aa9f9b9b3..c8e9cf262b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -122,6 +122,7 @@ unsafe impl GlobalAlloc for Jemalloc { #[inline] unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + assume!(!ptr.is_null()) assume!(layout.size() != 0); let flags = layout_to_flags(layout.align(), layout.size()); ffi::sdallocx(ptr as *mut c_void, layout.size(), flags)