From b5ea787044f51809efd6af40a6b079a48e2aec9c Mon Sep 17 00:00:00 2001
From: "Wolfgang (Blub) Bumiller" <blub@speed.at>
Date: Sat, 10 Nov 2012 12:17:05 +0100
Subject: [PATCH] util_memory_r with byte=0 will now call util_memory_d and
 return NULL

---
 util.c | 4 ++++
 1 file changed, 4 insertions(+)

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);
-- 
2.39.5