Re: [Linuxptp-users] Missing Sanity Checks for malloc()/calloc()/strdup() in linuxptp-1.5
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Miroslav L. <mli...@re...> - 2015-08-27 15:16:32
|
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. -- Miroslav Lichvar |