aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-01-11 08:56:53 -0800
committerGravatar Mark D. Roth <roth@google.com>2018-01-11 08:56:53 -0800
commit83d5cd602a7a4469ff6aeb72903db488b8d34d0b (patch)
tree03b32d05dd6da11b48b98b45473b2bdf4cde871c /src/core/ext/filters
parent473267b7e83cbedfa8902d00de8e2f12dbe62a0d (diff)
Don't unref null client_stats.
Diffstat (limited to 'src/core/ext/filters')
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index 5849ac9d2d..272b3617b2 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -340,7 +340,9 @@ static void pending_pick_set_metadata_and_context(pending_pick* pp) {
pp->pick->subchannel_call_context[GRPC_GRPCLB_CLIENT_STATS].destroy =
destroy_client_stats;
} else {
- grpc_grpclb_client_stats_unref(pp->client_stats);
+ if (pp->client_stats != nullptr) {
+ grpc_grpclb_client_stats_unref(pp->client_stats);
+ }
}
}
@@ -927,7 +929,9 @@ static void glb_shutdown_locked(grpc_lb_policy* pol,
pending_pick* next = pp->next;
if (new_policy != nullptr) {
// Hand pick over to new policy.
- grpc_grpclb_client_stats_unref(pp->client_stats);
+ if (pp->client_stats != nullptr) {
+ grpc_grpclb_client_stats_unref(pp->client_stats);
+ }
pp->pick->on_complete = pp->original_on_complete;
if (grpc_lb_policy_pick_locked(new_policy, pp->pick)) {
// Synchronous return; schedule callback.