FS#1646 close fp in error case to avoid resource leak
This commit is contained in:
parent
54dc911470
commit
2fd99a3c8f
@ -256,6 +256,7 @@ Repository::initFromCache( const string& cacheFile )
|
|||||||
if ( fgets( input, length, fp ) ) {
|
if ( fgets( input, length, fp ) ) {
|
||||||
line = stripWhiteSpace( input );
|
line = stripWhiteSpace( input );
|
||||||
if ( line != CACHE_VERSION ) {
|
if ( line != CACHE_VERSION ) {
|
||||||
|
close( fp );
|
||||||
return FORMAT_ERR;
|
return FORMAT_ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user