Do not leak unused links to track particles.
According to valgrind there are cases in which tracks are neither classified as primary nor secondary (presumably if the extrapolation to the perigee fails) in the JetFitterTrackSelectorTool:
==29847== 1,920 bytes in 60 blocks are definitely lost in loss record 110,036 of 122,833
==29847== at 0x4C2AAD2: operator new(unsigned long) (vg_replace_malloc.c:342)
==29847== by 0xF38336D9: InDet::JetFitterTrackSelectorTool::doTrackSelection(xAOD::Vertex_v1 const&, TLorentzVector const&, std::vector<xAOD::IParticle const*, std::allocator<xAOD::IParticle const*> > const&) const (JetFitterTrackSelectorTool.cxx:88)
==29847== by 0xF37E864C: InDet::InDetImprovedJetFitterVxFinder::findSecVertex(xAOD::Vertex_v1 const&, TLorentzVector const&, std::vector<xAOD::IParticle const*, std::allocator<xAOD::IParticle const*> > const&) const (InDetImprovedJetFitterVxFinder.cxx:148)
This is addressed by this patch.
Edited by Goetz Gaycken