diff --git a/modules/ml/src/nbayes.cpp b/modules/ml/src/nbayes.cpp index b9a966cd1d..5ad1b134d9 100644 --- a/modules/ml/src/nbayes.cpp +++ b/modules/ml/src/nbayes.cpp @@ -210,6 +210,8 @@ bool CvNormalBayesClassifier::train( const CvMat* _train_data, const CvMat* _res prod_data[c2] += train_vec[c2]*val1; } } + cvReleaseMat( &responses ); + responses = 0; /* calculate avg, covariance matrix, c */ for( cls = 0; cls < nclasses; cls++ )