Fixes of some memory leaks

This commit is contained in:
Piotr Miecielica
2013-11-19 17:35:27 +01:00
parent e69d2c1bb1
commit 923698d700
6 changed files with 18 additions and 5 deletions

View File

@@ -741,8 +741,11 @@ int LSVMparser(const char * filename, CvLSVMFilterObject *** model, int *last, i
//printf("parse : %s\n", filename);
xmlf = fopen(filename, "rb");
if(xmlf == NULL)
if(xmlf == NULL) {
free(*model);
*model = NULL;
return LSVM_PARSER_FILE_NOT_FOUND;
}
//i = 0;
j = 0;
@@ -808,6 +811,7 @@ int loadModel(
(*kPartFilters)[i] = (comp[i] - comp[i - 1]) - 1;
}
(*kPartFilters)[0] = comp[0];
free(comp);
return 0;
}