Re: Return value of malloc(0)
- From: Johannes Weiner <hnazfoo@xxxxxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 18:23:19 +0200
On Thu, Jun 29, 2006 at 06:09:37PM +0200, Matthias Andree wrote:
The value returned from malloc(0) must not be dereferenced whatever it
was. It was 0x800, which doesn't count as "failure".
But this would be appropriate for catching the error:
if ((foo = malloc(0)) == foo)
/* make noise */
wouldn't it?
Hannes
--
If the telephone rang today, water it!
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Return value of malloc(0)
- From: Matthias Andree
- Re: Return value of malloc(0)
- From: Harti Brandt
- Re: Return value of malloc(0)
- References:
- Return value of malloc(0)
- From: Andre Albsmeier
- Re: Return value of malloc(0)
- From: Johannes Weiner
- Re: Return value of malloc(0)
- From: Matthias Andree
- Return value of malloc(0)
- Prev by Date: Re: NVIDIA FreeBSD kernel feature requests
- Next by Date: Re: NVIDIA FreeBSD kernel feature requests
- Previous by thread: Re: Return value of malloc(0)
- Next by thread: Re: Return value of malloc(0)
- Index(es):