On 2019-09-18 10:37, Warner Losh wrote:
On Wed, Sep 18, 2019, 12:18 AM Conrad Meyer <c...@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

_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to