Skip to content

Commit

Permalink
Fix potential null pointer dereference.
Browse files Browse the repository at this point in the history
Signed-off-by: John Plevyak <jplevyak@gmail.com>
  • Loading branch information
jplevyak committed Sep 12, 2019
1 parent 9ddb95e commit e8b4e62
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 @@ -463,7 +463,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 e8b4e62

Please sign in to comment.