- coverity based bug fixes - round #1

This commit is contained in:
SoftCoder
2013-12-13 23:04:12 -08:00
parent c887b0c357
commit b9d6b38e8f
53 changed files with 651 additions and 416 deletions

View File

@@ -70,11 +70,12 @@ TextFTGL::TextFTGL(FontTextHandlerType type) : Text(type) {
}
if(ftFont->Error()) {
printf("FTGL: error loading font: %s\n", fontFile);
string fontFileName = (fontFile != NULL ? fontFile : "n/a");
printf("FTGL: error loading font: %s\n", fontFileName.c_str());
delete ftFont; ftFont = NULL;
free((void*)fontFile);
if(fontFile != NULL) free((void*)fontFile);
fontFile = NULL;
throw megaglest_runtime_error(string("FTGL: error loading font: ") + string(fontFile));
throw megaglest_runtime_error(string("FTGL: error loading font: ") + fontFileName);
}
free((void*)fontFile);
fontFile = NULL;