fixed memory leak in CvKNearest::train() and the constructor.

pull/13383/head
Vadim Pisarevsky 14 years ago
parent 2cf34c7f46
commit 4e099d2e5c
  1. 3
      modules/ml/src/knearest.cpp

@ -141,6 +141,9 @@ bool CvKNearest::train( const CvMat* _train_data, const CvMat* _responses,
ok = true; ok = true;
__END__; __END__;
if( responses && responses->data.ptr != _responses->data.ptr )
cvReleaseMat(&responses);
return ok; return ok;
} }

Loading…
Cancel
Save