Merge pull request #273 from nbougalis/static-analysis

Cleanups from static analysis
This commit is contained in:
Igor Canadi 2014-09-06 14:14:59 -07:00
commit db8ca520b2
5 changed files with 4 additions and 5 deletions

View File

@ -127,9 +127,6 @@ class Cache {
void LRU_Append(Handle* e);
void Unref(Handle* e);
struct Rep;
Rep* rep_;
// No copying allowed
Cache(const Cache&);
void operator=(const Cache&);

View File

@ -33,7 +33,7 @@ const char* GetExecutableName() {
char link[1024];
snprintf(link, sizeof(link), "/proc/%d/exe", getpid());
auto read = readlink(link, name, sizeof(name));
auto read = readlink(link, name, sizeof(name) - 1);
if (-1 == read) {
return nullptr;
} else {

View File

@ -70,7 +70,7 @@ class HashCuckooRep : public MemTableRep {
}
cuckoo_path_ = reinterpret_cast<int*>(
arena_->Allocate(sizeof(int*) * (cuckoo_path_max_depth_ + 1)));
arena_->Allocate(sizeof(int) * (cuckoo_path_max_depth_ + 1)));
is_nearly_full_ = false;
}

View File

@ -541,6 +541,7 @@ void ManifestDumpCommand::DoCommand() {
} else {
exec_state_ = LDBCommandExecuteResult::FAILED(
"Multiple MANIFEST files found; use --path to select one");
closedir(d);
return;
}
}

View File

@ -221,6 +221,7 @@ std::string FeatureSet::DebugString() const {
switch (iter.second.type()) {
case Variant::kNull:
out.append("null");
break;
case Variant::kBool:
if (iter.second.get_bool()) {
out.append("true");