loader: Malloc(0) should return NULL.

We really should not allocate anything with size 0.
This commit is contained in:
Toomas Soome 2019-09-16 20:28:08 +00:00
parent 1781ad707e
commit 41e2c61669
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352421

View File

@ -55,6 +55,9 @@ Malloc(size_t bytes, const char *file, int line)
{
Guard *res;
if (bytes == 0)
return (NULL);
#ifdef USEENDGUARD
bytes += MALLOCALIGN + 1;
#else