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

This commit is contained in:
Vadim Pisarevsky 2011-07-08 06:48:18 +00:00
parent 2cf34c7f46
commit 4e099d2e5c

View File

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