summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Penteker <tek@serverop.de>2018-06-01 01:03:13 +0200
committerThomas Penteker <tek@serverop.de>2018-06-01 01:03:13 +0200
commit2fd99a3c8fc5c75e28af71ac35472f6fe8908d37 (patch)
treeadf8db90824ccf089c6daba37a6fca20c50922b3
parent54dc9114702b7c83d7e47111ca2ab45faea2403c (diff)
downloadprt-get-2fd99a3c8fc5c75e28af71ac35472f6fe8908d37.tar.gz
prt-get-2fd99a3c8fc5c75e28af71ac35472f6fe8908d37.tar.xz
FS#1646 close fp in error case to avoid resource leak
-rw-r--r--src/repository.cpp1
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;
}
}

Generated by cgit