Fixed warning from static analyzer. accepted/tizen/5.5/unified/20200519.155021 accepted/tizen/unified/20200515.081437 submit/tizen/20200515.062155 submit/tizen_5.5/20200515.062629
authorKirill Frolov <k.frolov@samsung.com>
Tue, 17 Dec 2019 11:23:02 +0000 (14:23 +0300)
committerAlexander Soldatov/AI Compiler Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Tue, 17 Dec 2019 16:00:12 +0000 (19:00 +0300)
Variable `hr' might be uninitialized in case, when Initialized()
function was called twice.

src/profilerinfo.cpp

index 0551c8ea45758bd0600dc6967a92c37b0d8f4490..b3e2442df2825ee51e1bbbe6a68da6eb3a8a399b 100644 (file)
@@ -38,7 +38,7 @@ HRESULT ProfilerInfo::Initialize(IUnknown *pICorProfilerInfoUnk) noexcept
 {
     this->Reset(); // Ensure ProfilerInfo is in initial state.
 
-    HRESULT hr;
+    HRESULT hr = S_OK;  // for case when Initialize() called twice
 
     if (m_pProfilerInfo7 == nullptr)
     {