Skip to content

Commit

Permalink
AP_MultiHeap: ensure new heap initialised
Browse files Browse the repository at this point in the history
Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring committed Jan 4, 2025
1 parent 5f8a655 commit 1f5cfc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/AP_MultiHeap/MultiHeap_malloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ void *MultiHeap::heap_create(uint32_t size)
{
struct heap *new_heap = (struct heap*)malloc(sizeof(struct heap));
if (new_heap != nullptr) {
new_heap->magic = HEAP_MAGIC;
new_heap->max_heap_size = size;
new_heap->current_heap_usage = 0;
}
new_heap->magic = HEAP_MAGIC;
return (void *)new_heap;
}

Expand Down

0 comments on commit 1f5cfc1

Please sign in to comment.