FS#1646 close fp in error case to avoid resource leak

This commit is contained in:
Thomas Penteker 2018-06-01 01:03:13 +02:00
parent 54dc911470
commit 2fd99a3c8f
1 changed files with 1 additions and 0 deletions

View File

@ -256,6 +256,7 @@ Repository::initFromCache( const string& cacheFile )
if ( fgets( input, length, fp ) ) {
line = stripWhiteSpace( input );
if ( line != CACHE_VERSION ) {
close( fp );
return FORMAT_ERR;
}
}