Skip to content

Commit 5616583

Browse files
authored
[RF] fix memleak in RooAbsCollection::find()
#18322
1 parent 78d4c82 commit 5616583

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

roofit/roofitcore/src/RooAbsCollection.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ RooAbsArg * RooAbsCollection::find(const char *name) const
929929

930930
if (_hashAssistedFind || _list.size() >= _sizeThresholdForMapSearch) {
931931
if (!_hashAssistedFind || !_hashAssistedFind->isValid()) {
932+
if (_hashAssistedFind)
933+
delete _hashAssistedFind;
932934
_hashAssistedFind = new HashAssistedFind{_list.begin(), _list.end()};
933935
}
934936

0 commit comments

Comments
 (0)