> As I have understand, Linux returns ALWAYS success when using malloc(),
> because only reason why malloc() would fail, is memory overrun, and this
> will never happen in malloc().
Correct. Linux _always_ returns success in a malloc assuming the
parameters are reasonable.
> So my question is: is there any point in checking whether malloc() returned
> NULL (failure) or success? Should i just start using the memory without
> checking if the pointer is NULL?
I would still check, for two major reasons:
1) Someone might want to port your code to another platform whose
'malloc' implementation returns NULL under all sorts of circumstances.
2) Someone might link your code with a different 'malloc'
implementation that behaves differently.
DS
--------------------------------------------------------------------------
Jeane L. Dixon, world renowned psychic, died Saturday (1/25) at age 79.
There was almost universal sadness and lament throughout the world of
celebrity psychics. Contacted at her home, Dionne Warwick's spokeswoman
said that "[Miss] Warwick is beside herself -- none of us expected this to
happen".
--------------------------------------------------------------------------