techoe / ceres-solver

Automatically exported from code.google.com/p/ceres-solver
Other
0 stars 0 forks source link

One more leak leak in CXSparse::SolveCholesky #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
One more memory leak in cxsparse.cc:

See code:

bool CXSparse::SolveCholesky(cs_di* A,
                             cs_dis* symbolic_factorization,
                             double* b) {
  // Make sure we have enough scratch space available.
  if (scratch_size_ < A->n) {
    if (scratch_size_ > 0) {
      cs_free(scratch_);
    }
    // LEAK: scratch_ is allocated, but scratch_size_ is left unchanged!
    scratch_ = reinterpret_cast<CS_ENTRY*>(cs_malloc(A->n, sizeof(CS_ENTRY)));
  }

Original issue reported on code.google.com by ZZZ...@gmail.com on 4 Mar 2013 at 11:39

GoogleCodeExporter commented 9 years ago
Thanks Alexander for reporting this. We really do need better testing on 
windows with cxsparse. 
I have submitted a change for review, it should be in the master branch shortly.

 https://ceres-solver-review.googlesource.com/2616

Original comment by sameerag...@google.com on 4 Mar 2013 at 6:19