Amelek is being a bit harsh or just plain wrong; I learned a few days ago that checking malloc's return value means almost nothing:
https://news.ycombinator.com/item?id=7541585