On Wed, Sep 18, 2019, 9:44 AM Hans Petter Selasky <h...@selasky.org> wrote:

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

Such code isn't portable...

Warner

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

Reply via email to