Skip to content

Commit

Permalink
Fix potential null pointer dereference. (#103)
Browse files Browse the repository at this point in the history
Signed-off-by: John Plevyak <jplevyak@gmail.com>
  • Loading branch information
jplevyak authored Sep 13, 2019
1 parent 07a30a3 commit e5c31e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/common/upstream/cluster_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ bool ClusterManagerImpl::addOrUpdateCluster(const envoy::api::v2::Cluster& clust
existing_warming_cluster != warming_clusters_.end()) {
// The following init manager remove call is a NOP in the case we are already initialized. It's
// just kept here to avoid additional logic.
init_helper_.removeCluster(*existing_active_cluster->second->cluster_);
if (existing_active_cluster != active_clusters_.end()) {
init_helper_.removeCluster(*existing_active_cluster->second->cluster_);
}
cm_stats_.cluster_modified_.inc();
} else {
cm_stats_.cluster_added_.inc();
Expand Down

0 comments on commit e5c31e3

Please sign in to comment.