diff options
author | David Garcia Quintas <dgq@google.com> | 2017-06-23 18:24:01 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2017-06-23 18:24:01 -0700 |
commit | 38ba4661cec913c72b81beb15f34e263c694858b (patch) | |
tree | f3665a29b545740fe49531fefa68ca16e90464b9 /src | |
parent | 1b4be41a7212fa7ab18f73e1f8cebc12ddeffc0f (diff) |
Fix segfault in rr trace
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c index 3c8520cc1c..e7d38f751d 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c @@ -571,11 +571,13 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, GPR_ASSERT(sd->subchannel_list == p->latest_pending_subchannel_list); GPR_ASSERT(!sd->subchannel_list->shutting_down); if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { + const unsigned long num_subchannels = + p->subchannel_list != NULL ? p->subchannel_list->num_subchannels + : 0; gpr_log(GPR_DEBUG, "[RR %p] phasing out subchannel list %p (size %lu) in favor " "of %p (size %lu)", - (void *)p, (void *)p->subchannel_list, - (unsigned long)p->subchannel_list->num_subchannels, + (void *)p, (void *)p->subchannel_list, num_subchannels, (void *)sd->subchannel_list, (unsigned long)sd->subchannel_list->num_subchannels); } |