From f0bf674dc0d3aa7a9686e53cbb8702331bfb3875 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Sat, 1 Feb 2025 18:16:06 +0100 Subject: [PATCH] Fix wrong size in K_BHeapPush Z_Realloc --- src/k_bheap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_bheap.c b/src/k_bheap.c index b29f022dd..1a26bcf56 100644 --- a/src/k_bheap.c +++ b/src/k_bheap.c @@ -394,7 +394,7 @@ boolean K_BHeapPush(bheap_t *const heap, void *const item, UINT32 value, updatei if (heap->count >= heap->capacity) { size_t newarraycapacity = heap->capacity * 2; - heap->array = Z_Realloc(heap->array, newarraycapacity, PU_STATIC, NULL); + heap->array = Z_Realloc(heap->array, newarraycapacity * sizeof(bheapitem_t), PU_STATIC, NULL); if (heap->array == NULL) {