Egbugfixes valgrind errs72 x

This are the fixes for memory leaks that were fixed in january but by mistake never got merged into CMSSW. Second attempt at pull request as the first one seemed to not to be merged automatically once created for some reason