mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
util_memory_r with byte=0 will now call util_memory_d and return NULL
This commit is contained in:
parent
09e18e1bbf
commit
b5ea787044
1 changed files with 4 additions and 0 deletions
4
util.c
4
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);
|
||||
|
|
Loading…
Reference in a new issue