From 431b1d452145bc9bd591655c4f009c54d9f1c25c Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Wed, 2 Oct 2024 16:00:13 +0200 Subject: [PATCH] [LLVM Analysis] Fix potential memory leak in ApvAnalysisFactory::constructAuxiliaryApvClasses --- CalibTracker/SiStripAPVAnalysis/src/ApvAnalysisFactory.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CalibTracker/SiStripAPVAnalysis/src/ApvAnalysisFactory.cc b/CalibTracker/SiStripAPVAnalysis/src/ApvAnalysisFactory.cc index 0eeb46f956f28..f224ad6d45250 100644 --- a/CalibTracker/SiStripAPVAnalysis/src/ApvAnalysisFactory.cc +++ b/CalibTracker/SiStripAPVAnalysis/src/ApvAnalysisFactory.cc @@ -118,10 +118,12 @@ void ApvAnalysisFactory::constructAuxiliaryApvClasses(ApvAnalysis* theAPV, uint3 theCM = new MedianCommonModeCalculator(); } else { cout << "Sorry Only Median is available for now, Mean and FastLinear are coming soon" << endl; + delete theCommonMode; return; } } else { cout << "ApvAnalysisFactory: algorithm " << theAlgorithmType_ << " not supported" << endl; + delete theCommonMode; return; }