> -----Original Message-----
> From: Miroslav Lichvar [mailto:[email protected]]
> Sent: Thursday, August 27, 2015 8:16 AM
> To: [email protected]
> Subject: Re: [Linuxptp-users] Missing Sanity Checks for
> malloc()/calloc()/strdup() in linuxptp-1.5
> 
> On Thu, Aug 27, 2015 at 04:06:23PM +0200, Xavier Bestel wrote:
> > Under linux malloc() will only return NULL when you get out of address
> > space, i.e. virtually never on a 64bits machine. Low memory situations are
> > handled elsewhere (e.g. OOM killer).
> > So I don't think checking malloc() for NULL is that wise.
> 
> It depends on the kernel overcommit configuration. In the default
> configuration getting NULL is unlikely, but that doesn't mean it
> should result in a segfault. I'm just not convinced there is any point
> in trying to recover from that.
> 

Generally, no, and I would prefer we at least try and die gracefully, and if 
*every* place we check will die gracefully, then why force each end point to 
die itself?

By die gracefully here, I mean not segfault, but just instantly quit.

Regards,
Jake


------------------------------------------------------------------------------
_______________________________________________
Linuxptp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to