Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing uninitialized field during VizCollector constructor call
collector_ is not initialized on VizCollector constructor call,
when method DbGlobalName is called. This method, in turn, calls
method collector_->DbGlobalName. Since this method does not make any
reference to object data (this being the reason it does not visbly
crash) the method could be made static.

Change-Id: Ifaa8d0c5affc33aee48a2328a427ef1eb6b6c74d
Closes-Bug: #1774968
  • Loading branch information
abgzlnv committed Jun 7, 2018
1 parent 4144dae commit 947e357
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contrail-collector/collector.h
Expand Up @@ -113,7 +113,7 @@ class Collector : public SandeshServer {
const CollectorStats &GetStats() const { return stats_; }
void SendGeneratorStatistics();

std::string DbGlobalName(bool dup=false);
static std::string DbGlobalName(bool dup=false);
void CloseGeneratorSession(std::string source, std::string module,
std::string instance, std::string node_type);
protected:
Expand Down
2 changes: 1 addition & 1 deletion contrail-collector/viz_collector.cc
Expand Up @@ -101,7 +101,7 @@ VizCollector::~VizCollector() {
}

std::string VizCollector::DbGlobalName(bool dup) {
return collector_->DbGlobalName(dup);
return Collector::DbGlobalName(dup);
}

bool VizCollector::SendRemote(const string& destination,
Expand Down

0 comments on commit 947e357

Please sign in to comment.