mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-07 09:52:40 +08:00
fix resource leaks - issues 1034, 1038, 1040. Thanks to Martin Ettl
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@920 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
b8d7a1d139
commit
9de80e0a06
@ -393,6 +393,7 @@ void TessBaseAPI::GetAvailableLanguagesAsVector(
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -408,6 +408,7 @@ bool MasterTrainer::LoadXHeights(const char* filename) {
|
||||
}
|
||||
if (xheight_count == 0) {
|
||||
fprintf(stderr, "No valid xheights in %s!\n", filename);
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
int mean_xheight = DivRounded(total_xheight, xheight_count);
|
||||
|
@ -133,6 +133,7 @@ FILE *CharSampSet::CreateCharDumpFile(string file_name) {
|
||||
// read and verify marker
|
||||
val32 = 0xfefeabd0;
|
||||
if (fwrite(&val32, 1, sizeof(val32), fp) != sizeof(val32)) {
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
return fp;
|
||||
|
Loading…
Reference in New Issue
Block a user