diff options
author | Thomas Penteker <tek@serverop.de> | 2018-06-01 01:03:13 +0200 |
---|---|---|
committer | Thomas Penteker <tek@serverop.de> | 2018-06-01 01:03:13 +0200 |
commit | 2fd99a3c8fc5c75e28af71ac35472f6fe8908d37 (patch) | |
tree | adf8db90824ccf089c6daba37a6fca20c50922b3 /src | |
parent | 54dc9114702b7c83d7e47111ca2ab45faea2403c (diff) | |
download | prt-get-2fd99a3c8fc5c75e28af71ac35472f6fe8908d37.tar.gz prt-get-2fd99a3c8fc5c75e28af71ac35472f6fe8908d37.tar.xz |
FS#1646 close fp in error case to avoid resource leak
Diffstat (limited to 'src')
-rw-r--r-- | src/repository.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/repository.cpp b/src/repository.cpp index e911095..9e122d3 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -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; } } |