From: Wolfgang (Blub) Bumiller Date: Sat, 10 Nov 2012 11:17:05 +0000 (+0100) Subject: util_memory_r with byte=0 will now call util_memory_d and return NULL X-Git-Tag: 0.1~41^2 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=b5ea787044f51809efd6af40a6b079a48e2aec9c;p=xonotic%2Fgmqcc.git util_memory_r with byte=0 will now call util_memory_d and return NULL --- diff --git a/util.c b/util.c index e814ce6..ec115cd 100644 --- a/util.c +++ b/util.c @@ -86,6 +86,10 @@ void *util_memory_r(void *ptrn, unsigned int byte, unsigned int line, const char if (!ptrn) return util_memory_a(byte, line, file); + if (!byte) { + util_memory_d(ptrn, line, file); + return NULL; + } oldinfo = ((struct memblock_t*)ptrn - 1); newinfo = malloc(sizeof(struct memblock_t) + byte);