Fix issue with unchecked malloc result (which is the reason of an issue raising by the VERACODE scanner)

VERACODE static analyser issue: http://screencast.com/t/aqJxSgusX