[Genabel-commits] r1491 - pkg/filevector/tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Dec 19 23:38:27 CET 2013
Author: lckarssen
Date: 2013-12-19 23:38:27 +0100 (Thu, 19 Dec 2013)
New Revision: 1491
Modified:
pkg/filevector/tests/BuildTestData.cpp
Log:
Fixed memory leak in one of the filevector tests. Thanks Jenkins/cppcheck for reporting this!
Modified: pkg/filevector/tests/BuildTestData.cpp
===================================================================
--- pkg/filevector/tests/BuildTestData.cpp 2013-12-19 21:56:04 UTC (rev 1490)
+++ pkg/filevector/tests/BuildTestData.cpp 2013-12-19 22:38:27 UTC (rev 1491)
@@ -55,7 +55,7 @@
for(i=0;i<numObservations;i++){
obsSums[i] = 0.;
}
-
+
for(j=0;j<numVariables;j++){
double sum = 0;
@@ -70,6 +70,8 @@
for(i=0;i<numObservations;i++){
obsSumFile << obsSums[i] << " ";
}
+
+ delete[] obsSums;
}
int main(int numArgs, char**args){
@@ -121,7 +123,7 @@
if (subMatrixNumVars > 0)
buildSubmatrix(baseName, numVariables, numObservations, subMatrixNumVars, subMatrixNumObs);
- cout << "Writing " << baseName << "..." << endl;
+ cout << "Writing " << baseName << "..." << endl;
text2fvf("text2fvf", textFileName, baseName,"", "", 1, 1,0, 0, true, true, DOUBLE, true,"NAN");
cout << "Done." << endl;
-}
\ No newline at end of file
+}
More information about the Genabel-commits
mailing list