From 6573fa88835ae501cfee34a0f9eeb514cad98bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Gr=C3=B6n?= Date: Sat, 28 Dec 2019 10:55:53 +0100 Subject: [PATCH] Fix memory leak in radTSend::OutRelaxResultsInfo TotOutArray was not properly deallocated. --- cpp/src/core/radsend.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/core/radsend.cpp b/cpp/src/core/radsend.cpp index 07a11e69..7cb9dac9 100644 --- a/cpp/src/core/radsend.cpp +++ b/cpp/src/core/radsend.cpp @@ -1957,15 +1957,15 @@ void radTSend::OutRelaxResultsInfo(double* RelaxStatusParamArray, int lenRelaxSt //#ifdef __JAVA__ #if defined __JAVA__ || defined ALPHA__DLL__ || defined ALPHA__LIB__ int TotOutElem = lenRelaxStatusParamArray + 1; - double *TotOutArray = new double[TotOutElem]; - if(TotOutArray == 0) { ErrorMessage("Radia::Error900"); return;} - double *t = TotOutArray; + std::vector TotOutArray; + TotOutArray.resize(TotOutElem); + double *t = TotOutArray.data(); double *tRelaxStatusParamArray = RelaxStatusParamArray; for(int i=0; i