Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Coverity issues in contrail-common repo
- Variable fp going out of scope leaks the storage it points to in misc_utils.cc:MiscUtils::GetPlatformInfo
- Missing return statement in t_cpp_generator.cc:generate_sandesh_base_name
- Missing return statement in sandesh_message_builder.cc:SandeshSyslogMessage::Parse
- Missing return statement in sandesh_server.cc:SandeshServer::Initialize

Change-Id: I02c25ec037c73a1d4e3024e257558a4f81310a49
Closes-Bug: #1770142
Signed-off-by: Anda Nicolae <anicolae@lenovo.com>
  • Loading branch information
Anda Nicolae committed Jun 5, 2018
1 parent 6bc9661 commit dc6fb81
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions base/misc_utils.cc
Expand Up @@ -202,6 +202,7 @@ bool MiscUtils::GetPlatformInfo(std::string &distro, std::string &code_name) {
} else {
return false;
}
fclose(fp);
#endif
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion sandesh/compiler/generate/t_cpp_generator.cc
Expand Up @@ -1857,8 +1857,9 @@ string generate_sandesh_base_name(t_sandesh* tsandesh, bool type) {
return "SandeshFlow";
}
}
} else {
return "";
}

}

/**
Expand Down
1 change: 1 addition & 0 deletions sandesh/library/cpp/sandesh_message_builder.cc
Expand Up @@ -151,6 +151,7 @@ bool SandeshSyslogMessage::Parse(const uint8_t *xml_msg, size_t size) {
message_node_ = xdoc_.first_child();
message_type_ = message_node_.name();
size_ = size;
return true;
}

// SandeshMessageBuilder
Expand Down
1 change: 1 addition & 0 deletions sandesh/library/cpp/sandesh_server.cc
Expand Up @@ -132,6 +132,7 @@ bool SandeshServer::Initialize(short port) {
SANDESH_LOG(ERROR, "Process EXITING: TCP Server initialization failed for port " << port);
exit(1);
}
return true;
}

int SandeshServer::AllocConnectionIndex() {
Expand Down

0 comments on commit dc6fb81

Please sign in to comment.