util_memory_r with byte=0 will now call util_memory_d and return NULL

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-10 12:17:05 +01:00
parent 09e18e1bbf
commit b5ea787044

4
util.c
View file

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