Skip to content

Commit db8ca52

Browse files
committed
Merge pull request XRPLF#273 from nbougalis/static-analysis
Cleanups from static analysis
2 parents b7b031f + 9f8aa09 commit db8ca52

File tree

5 files changed

+4
-5
lines changed

5 files changed

+4
-5
lines changed

include/rocksdb/cache.h

-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ class Cache {
127127
void LRU_Append(Handle* e);
128128
void Unref(Handle* e);
129129

130-
struct Rep;
131-
Rep* rep_;
132-
133130
// No copying allowed
134131
Cache(const Cache&);
135132
void operator=(const Cache&);

port/stack_trace.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const char* GetExecutableName() {
3333

3434
char link[1024];
3535
snprintf(link, sizeof(link), "/proc/%d/exe", getpid());
36-
auto read = readlink(link, name, sizeof(name));
36+
auto read = readlink(link, name, sizeof(name) - 1);
3737
if (-1 == read) {
3838
return nullptr;
3939
} else {

util/hash_cuckoo_rep.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class HashCuckooRep : public MemTableRep {
7070
}
7171

7272
cuckoo_path_ = reinterpret_cast<int*>(
73-
arena_->Allocate(sizeof(int*) * (cuckoo_path_max_depth_ + 1)));
73+
arena_->Allocate(sizeof(int) * (cuckoo_path_max_depth_ + 1)));
7474
is_nearly_full_ = false;
7575
}
7676

util/ldb_cmd.cc

+1
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ void ManifestDumpCommand::DoCommand() {
541541
} else {
542542
exec_state_ = LDBCommandExecuteResult::FAILED(
543543
"Multiple MANIFEST files found; use --path to select one");
544+
closedir(d);
544545
return;
545546
}
546547
}

utilities/spatialdb/spatial_db.cc

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ std::string FeatureSet::DebugString() const {
221221
switch (iter.second.type()) {
222222
case Variant::kNull:
223223
out.append("null");
224+
break;
224225
case Variant::kBool:
225226
if (iter.second.get_bool()) {
226227
out.append("true");

0 commit comments

Comments
 (0)