[cvs-nhc98] Add a check for sufficient heap before allocating an array.