From 98935fe7a9ab3a3b8433828ef31101e6c55e6a71 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 29 Mar 2012 21:17:19 +0000 Subject: [PATCH] Don't fall back on allocache if malloc'ing a palookup buffer or transluc table fails. First, it's unlikely in our day and age. Second, they're always free'd at the end, so allocache'ing them is incorrect. git-svn-id: https://svn.eduke32.com/eduke32@2570 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 95025d59e..c63d18701 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -7343,10 +7343,10 @@ static int32_t loadpalette(void) kread(fil,palette,768); kread(fil,&numshades,2); numshades = B_LITTLE16(numshades); - if ((palookup[0] = (char *)Bmalloc(numshades<<8)) == NULL) - allocache((intptr_t *)&palookup[0],numshades<<8,&permanentlock); - if ((transluc = (char *)Bmalloc(65536)) == NULL) - allocache((intptr_t *)&transluc,65536,&permanentlock); + palookup[0] = Bmalloc(numshades<<8); + transluc = Bmalloc(65536); + if (palookup[0] == NULL || transluc == NULL) + exit(1); globalpalwritten = palookup[0]; globalpal = 0; setpalookupaddress(globalpalwritten); @@ -13434,8 +13434,9 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8 if (palookup[palnum] == NULL) { //Allocate palookup buffer - if ((palookup[palnum] = (char *)Bmalloc(numshades<<8)) == NULL) - allocache((intptr_t *)&palookup[palnum],numshades<<8,&permanentlock); + palookup[palnum] = Bmalloc(numshades<<8); + if (palookup[palnum] == NULL) + exit(1); } if (dastat == 0) return;