提交 9de80e0a 编写于 作者: Z zdenop

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
上级 b8d7a1d1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册