TRQ-2005 Check return of a malloc and fail nicely.