From 6a69c5673fff9c909eaadac6b7e2ddc93403c679 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 14 Oct 2018 14:59:40 +1000 Subject: Fix gfxRealloc bug for RAW32 (and derivitives) --- src/gos/gos_x_heap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gos/gos_x_heap.c b/src/gos/gos_x_heap.c index d7a07537..1a8f1061 100644 --- a/src/gos/gos_x_heap.c +++ b/src/gos/gos_x_heap.c @@ -135,7 +135,7 @@ // We need to do this the hard way pfree = gfxAlloc(sz); - if (pfree) + if (!pfree) return 0; memcpy(pfree, ptr, p->sz - sizeof(memslot)); gfxFree(ptr); @@ -162,7 +162,7 @@ break; } } - + // Find a free slot that is contiguous after and merge it into this one for (prev = 0, pfree = freeSlots; pfree != 0; prev = pfree, pfree = NextFree(pfree)) { if (pfree == (memslot *)((char *)p + p->sz)) { -- cgit v1.2.3