svn commit: r352451 - head/stand/libsa
Hans Petter Selasky
hps at selasky.org
Wed Sep 18 08:44:13 UTC 2019
On 2019-09-18 10:37, Warner Losh wrote:
> On Wed, Sep 18, 2019, 12:18 AM Conrad Meyer <cem at freebsd.org> wrote:
>
>> Well, hang on; it's also perfectly legal for a malloc implementation
>> to return NULL for requests of zero bytes. You can access exactly the
>> number of bytes requested in the allocation; and free(NULL) works as
>> expected. NULL (0) is also aligned to any size you could want.
>>
>
> Legal, yes. But it is different than all the other FreeBSD environments,
> so the loader becomes the odd man out. This restores the consistency.
>
Hi,
The problem is the code that use malloc() that take NULL as a failure,
even if the size is zero :-)
array = malloc(n * sizeof(q));
if (array == NULL)
goto failure;
--HPS
More information about the svn-src-all
mailing list