check to make sure malloc worked