mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-31 01:28:27 +00:00
Possible fix for leaks during entry expiry / truncation (#340)
This commit is contained in:
parent
676b2090fb
commit
d57c12d3c3
@ -496,10 +496,12 @@ bool StatCache::TruncateCache(void)
|
||||
for(stat_cache_t::iterator iter = stat_cache.begin(); iter != stat_cache.end(); ){
|
||||
stat_cache_entry* entry = iter->second;
|
||||
if(!entry || (0L < entry->notruncate && IsExpireStatCacheTime(entry->cache_date, ExpireTime))){
|
||||
stat_cache.erase(iter++);
|
||||
}else{
|
||||
++iter;
|
||||
if(entry){
|
||||
delete entry;
|
||||
}
|
||||
stat_cache.erase(iter);
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,6 +534,9 @@ bool StatCache::TruncateCache(void)
|
||||
stat_cache_t::iterator siter = *iiter;
|
||||
|
||||
S3FS_PRN_DBG("truncate stat cache[path=%s]", siter->first.c_str());
|
||||
if(siter->second){
|
||||
delete siter->second;
|
||||
}
|
||||
stat_cache.erase(siter);
|
||||
}
|
||||
S3FS_MALLOCTRIM(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user