Explorar o código

Fix: check if next block is free for coalescing three blocks.

Ioannis Koutras %!s(int64=13) %!d(string=hai) anos
pai
achega
c31e3b8c4c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/custom_free.c

+ 1 - 1
src/custom_free.c

@@ -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))) {