diff --git a/src/system/kernel/heap.cpp b/src/system/kernel/heap.cpp index d7b9a7ea9a..e277a5b32c 100644 --- a/src/system/kernel/heap.cpp +++ b/src/system/kernel/heap.cpp @@ -1158,7 +1158,7 @@ heap_realloc(heap_allocator *heap, void *address, void **newAddress, // copy the old data and free the old allocation memcpy(*newAddress, address, min_c(maxSize, newSize)); - free(address); + heap_free(heap, address); return B_OK; }