Fixes of some memory leaks
This commit is contained in:
@@ -2619,8 +2619,10 @@ void HOGDescriptor::readALTModel(std::string modelfile)
|
||||
double *linearwt = new double[totwords+1];
|
||||
int length = totwords;
|
||||
nread = fread(linearwt, sizeof(double), totwords + 1, modelfl);
|
||||
if(nread != static_cast<size_t>(length) + 1)
|
||||
if(nread != static_cast<size_t>(length) + 1) {
|
||||
delete [] linearwt;
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
for(int i = 0; i < length; i++)
|
||||
detector.push_back((float)linearwt[i]);
|
||||
|
Reference in New Issue
Block a user