]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
util_memory_r with byte=0 will now call util_memory_d and return NULL
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 10 Nov 2012 11:17:05 +0000 (12:17 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 10 Nov 2012 11:17:05 +0000 (12:17 +0100)
util.c

diff --git a/util.c b/util.c
index e814ce646a33397179e8dcd52c503300636270c9..ec115cdddb4097897e49d6fd0bf64ca914f35506 100644 (file)
--- 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);