Skip to content

Commit

Permalink
Fix segfault in unused StSvtSeqAdjMaker (#576)
Browse files Browse the repository at this point in the history
In some bfc.C tests, this maker may get instantiated but, Init() is
never called. Pointers not initialized to NULL in the constructor may
potentially be non-zero in the destructor, leading to needless seg
faults when quitting root4star.

Simple test: root4star -b -q -l 'bfc.C(-1)'
  • Loading branch information
genevb committed Aug 15, 2023
1 parent 3a748c7 commit 92e8ad4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion StRoot/StSvtSeqAdjMaker/StSvtSeqAdjMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ StSvtSeqAdjMaker::StSvtSeqAdjMaker(const char *name) : StMaker(name)
// Set up some defaults

mPedFile = NULL;
hfile = NULL;
mPedOffSet = 20;
m_thresh_lo = 3+mPedOffSet;
m_thresh_hi = 5+mPedOffSet;
Expand All @@ -237,7 +238,6 @@ StSvtSeqAdjMaker::~StSvtSeqAdjMaker(){
Int_t StSvtSeqAdjMaker::Init(){


hfile = NULL;
GetSvtRawData();

SetSvtData();
Expand Down

0 comments on commit 92e8ad4

Please sign in to comment.