Fix a clang analyze error (#5365)
Summary: The analyzer thinks max_allowed_ space can be 0. In that case, free_space will be assigned as free_space. It fails to realize that the function call GetFreeSpace actually sets the free_space variable properly, which is possibly due to lack of inter-function call analysis. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5365 Differential Revision: D15521790 Pulled By: riversand963 fbshipit-source-id: 839d0a285a1c8773a28a385f0c3be4bb7fbe32cb
This commit is contained in:
parent
e264eebcd7
commit
b5e4ee2e76
@ -264,7 +264,7 @@ void SstFileManagerImpl::ClearError() {
|
||||
return;
|
||||
}
|
||||
|
||||
uint64_t free_space;
|
||||
uint64_t free_space = 0;
|
||||
Status s = env_->GetFreeSpace(path_, &free_space);
|
||||
free_space = max_allowed_space_ > 0
|
||||
? std::min(max_allowed_space_, free_space)
|
||||
|
Loading…
x
Reference in New Issue
Block a user