Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary matrix (neighborPtr) being improperly deleted in neighbor_search_impl.hpp #478

Closed
lpsavalhais opened this issue Nov 20, 2015 · 1 comment

Comments

@lpsavalhais
Copy link

File neighbor_search_impl.hpp
on method:
void NeighborSearch<SortPolicy, MetricType, MatType, TreeType, TraversalType>::
Search(const MatType& querySet,
const size_t k,
arma::Mat<size_t>& neighbors,
arma::mat& distances)

At line 461:
---> delete neighborPtr;

But in this case, when treeOwner is false, the matrix neighborPtr is not allocated with "new".

@rcurtin
Copy link
Member

rcurtin commented Nov 20, 2015

Nice catch! Thanks so much for pointing this out.

@rcurtin rcurtin added this to the mlpack 1.1.0 milestone Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants