Skip to content
Snippets Groups Projects
Commit 46006f9d authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

fix memory leak

[[Imported from SVN: r9422]]
parent 8b37e374
No related branches found
No related tags found
No related merge requests found
......@@ -202,7 +202,7 @@ assembleHessian(const Entity& element,
/////////////////////////////////////////////////////////////////
// Compute Hessian
/////////////////////////////////////////////////////////////////
double** rawHessian = (double**) malloc(nDoubles*sizeof(double*));
double* rawHessian[nDoubles];
for(size_t i=0; i<nDoubles; i++)
rawHessian[i] = (double*)malloc((i+1)*sizeof(double));
hessian(1,nDoubles,xp.data(),rawHessian);
......@@ -216,6 +216,9 @@ assembleHessian(const Entity& element,
}
}
for(size_t i=0; i<nDoubles; i++)
free(rawHessian[i]);
// From this, compute the Hessian with respect to the manifold (which we assume here is embedded
// isometrically in a Euclidean space.
// For the detailed explanation of the following see: Absil, Mahoney, Trumpf, "An extrinsic look
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment