Do not leak filehandles.

Nicky 2015-04-18 01:37:11 +02:00
parent d9092fc2af
commit ee9f8c4d0e
1 changed files with 2 additions and 0 deletions

View File

@ -1182,6 +1182,7 @@ bool LLImageTGA::loadFile( const std::string& path )
if(!buffer)
{
LL_WARNS() << "could not allocate memory for image loading, size: " << file_size << LL_ENDL;
fclose(file); // <FS:ND/> Do not leak the file handle.
return false;
}
@ -1190,6 +1191,7 @@ bool LLImageTGA::loadFile( const std::string& path )
{
deleteData();
LL_WARNS() << "Couldn't read file " << path << LL_ENDL;
fclose(file); // <FS:ND/> Do not leak the file handle.
return false;
}