From 9edfa31f5491081bccfde311068338850cf64ed0 Mon Sep 17 00:00:00 2001 From: Randolf Beerwerth <r.beerwerth@fz-juelich.de> Date: Fri, 21 Aug 2020 12:54:10 +0200 Subject: [PATCH] Fix Use-after-free in RTTest --- Tests/UnitTests/Core/Sample/RTTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/UnitTests/Core/Sample/RTTest.cpp b/Tests/UnitTests/Core/Sample/RTTest.cpp index 296f63dff89..b9f4ef66bb3 100644 --- a/Tests/UnitTests/Core/Sample/RTTest.cpp +++ b/Tests/UnitTests/Core/Sample/RTTest.cpp @@ -30,11 +30,11 @@ protected: EXPECT_NEAR(coeff1.t_r(1).real(), coeff2.t_r(1).real(), 1e-10); EXPECT_NEAR(coeff1.t_r(1).imag(), coeff2.t_r(1).imag(), 1e-10); } - std::vector<ScalarRTCoefficients> getCoeffs(SpecularScalarTanhStrategy::coeffs_t&& inputCoeffs) + std::vector<ScalarRTCoefficients> getCoeffs(ISpecularStrategy::coeffs_t&& inputCoeffs) { std::vector<ScalarRTCoefficients> result; for (auto& coeff : inputCoeffs) - result.push_back(*dynamic_cast<const ScalarRTCoefficients*>(coeff.get())); + result.push_back(*dynamic_cast<const ScalarRTCoefficients*>(coeff.release())); return result; } -- GitLab