Fix a memory leak in CXSparse::SolveCholesky.

Thanks to Alexander Mordvintsev for reporting this.

Change-Id: I5c6be4d3d28f062e83a1ad41cb8089c19362a005
This commit is contained in:
Sameer Agarwal
2013-03-04 10:17:30 -08:00
parent 480f9b8551
commit e7148795c3
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -57,6 +57,7 @@ bool CXSparse::SolveCholesky(cs_di* A,
cs_free(scratch_);
}
scratch_ = reinterpret_cast<CS_ENTRY*>(cs_malloc(A->n, sizeof(CS_ENTRY)));
scratch_size_ = A->n;
}
// Solve using Cholesky factorization
@@ -370,7 +370,7 @@ TEST(TrustRegionMinimizer, JacobiScalingTest) {
EXPECT_LE(summary.final_cost, 1e-10);
for (int i = 0; i < N; i++) {
delete y[i];
delete []y[i];
}
}