@@ -122,7 +122,7 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
previous_current_size = (size_t) -1; /* SIZE_MAX */
}
- if(next_block != NULL && is_previous_free(ptr)) {
+ if(next_block != NULL && is_previous_free(ptr) && is_free(next_block)) {
#ifdef WITH_OWNERSHIP
if(get_owner(ptr) == get_owner(get_dlprevious(ptr) &&
get_owner(ptr) == get_owner(next_block))) {