Skip to content

Commit c9b7589

Browse files
committed
Merge remote-tracking branch 'refs/remotes/mariusmuja/master'
2 parents 53e4ab8 + 31bcbef commit c9b7589

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cpp/flann/algorithms/kmeans_index.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ class KMeansIndex : public NNIndex<Distance>
416416
Index* obj = static_cast<Index*>(ar.getObject());
417417

418418
if (Archive::is_loading::value) {
419+
delete[] pivot;
419420
pivot = new DistanceType[obj->veclen_];
420421
}
421422
ar & serialization::make_binary_object(pivot, obj->veclen_*sizeof(DistanceType));
@@ -524,6 +525,7 @@ class KMeansIndex : public NNIndex<Distance>
524525

525526
node->variance = variance;
526527
node->radius = radius;
528+
delete[] node->pivot;
527529
node->pivot = mean;
528530
}
529531

0 commit comments

Comments
 (0)