diff --git a/roofit/roofitcore/src/RooAbsCollection.cxx b/roofit/roofitcore/src/RooAbsCollection.cxx index 400443057b116..4389607df97b8 100644 --- a/roofit/roofitcore/src/RooAbsCollection.cxx +++ b/roofit/roofitcore/src/RooAbsCollection.cxx @@ -929,6 +929,8 @@ RooAbsArg * RooAbsCollection::find(const char *name) const if (_hashAssistedFind || _list.size() >= _sizeThresholdForMapSearch) { if (!_hashAssistedFind || !_hashAssistedFind->isValid()) { + if (_hashAssistedFind) + delete _hashAssistedFind; _hashAssistedFind = new HashAssistedFind{_list.begin(), _list.end()}; }