diff --git a/input.cc b/input.cc index fee71c357..9d15b5be0 100644 --- a/input.cc +++ b/input.cc @@ -815,7 +815,7 @@ void read_atomicdata_files() { // store the ions data to memory and set up the ions zeta and levellist globals::elements[element].ions[ion] = { - .levels = static_cast(malloc(nlevelsmax * sizeof(EnergyLevel))), + .levels = static_cast(calloc(nlevelsmax, sizeof(EnergyLevel))), .ionstage = ionstage, .nlevels = nlevelsmax, .nlevels_nlte = 0,