fix memory leak reported at https://redmine.cbm.gsi.de/issues/2570.
Extend suggestions of PAL. Move MR from the mCBM fork to cbmroot master.
PAl edit: Refs #2570
Edited by Pierre-Alain Loizeau
Extend suggestions of PAL. Move MR from the mCBM fork to cbmroot master.
PAl edit: Refs #2570