Skip to content

Commit

Permalink
Avoid nullptr dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
pcanal committed Apr 17, 2017
1 parent 6eb83c4 commit 5ff21c9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hist/hist/src/TF1.cxx
Expand Up @@ -628,10 +628,12 @@ void TF1::DoInitialize(EAddToList addToGlobalList)
R__LOCKGUARD2(gROOTMutex);
// Store formula in linked list of formula in ROOT
TF1 *f1old = (TF1 *)gROOT->GetListOfFunctions()->FindObject(fName);
gROOT->GetListOfFunctions()->Remove(f1old);
// We removed f1old from the list, it is not longer global.
// (See TF1::AddToGlobalList which requires this flag to be correct).
f1old->SetBit(kNotGlobal, kTRUE);
if (f1old) {
gROOT->GetListOfFunctions()->Remove(f1old);
// We removed f1old from the list, it is not longer global.
// (See TF1::AddToGlobalList which requires this flag to be correct).
f1old->SetBit(kNotGlobal, kTRUE);
}
gROOT->GetListOfFunctions()->Add(this);
} else
SetBit(kNotGlobal, kTRUE);
Expand Down

2 comments on commit 5ff21c9

@smuzaffar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcanal , can you please include this for root v6-08-00-patches

@pcanal
Copy link
Member Author

@pcanal pcanal commented on 5ff21c9 May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Please sign in to comment.