The materials array was being allocated even when `eval_totcol` is zero. The material code assumes that the array is nullptr when totcol is zero and would leak that memory. Only allocate the array when the material count is greater than zero.
The materials array was being allocated even when `eval_totcol` is zero. The material code assumes that the array is nullptr when totcol is zero and would leak that memory. Only allocate the array when the material count is greater than zero.