<p>File neighbor_search_impl.hpp<br>
on method:<br>
void NeighborSearch::<br>
Search(const MatType&amp; querySet,<br>
       const size_t k,<br>
       arma::Mat&amp; neighbors,<br>
       arma::mat&amp; distances)</p>

<p>At line 461:<br>
---&gt; delete neighborPtr; </p>

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

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/478">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFKJ7b8GWjFU_y-AdyUfRZ9V5kWoRks5pHxHDgaJpZM4GmWfZ.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/478"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>