Commit 4e099d2e authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

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

parent 2cf34c7f
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment