Sfoglia il codice sorgente

The new block after a split should be the one to be set free and properly set of a heap owner.

Ioannis Koutras 14 anni fa
parent
commit
3c231f9a82
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      src/split.c

+ 2 - 1
src/split.c

@@ -40,7 +40,8 @@ void split(allocator_t *allocator, heap_t *heap, void *ptr,
         heap->free_list_head = new_block;
     }
 
-    mark_free(ptr);
+    set_owner(new_block, heap);
+    mark_free(new_block);
 
     if(allocator->border_ptr == ptr) {
         allocator->border_ptr = new_block;