From 8006949fd372d0e18317060d0d070e9bd5d71401 Mon Sep 17 00:00:00 2001
From: David Garcia Quintas <dgq@google.com>
Date: Tue, 8 Nov 2016 14:17:48 -0800
Subject: [PATCH] Added assert for lb_token before reffing it

---
 src/core/ext/lb_policy/grpclb/grpclb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c
index 9f37dc9a67..a69b5c8e51 100644
--- a/src/core/ext/lb_policy/grpclb/grpclb.c
+++ b/src/core/ext/lb_policy/grpclb/grpclb.c
@@ -186,6 +186,7 @@ static void wrapped_rr_closure(grpc_exec_ctx *exec_ctx, void *arg,
      * addresses failed to connect). There won't be any user_data/token
      * available */
     if (wc_arg->target != NULL) {
+      GPR_ASSERT(wc_arg->lb_token != NULL);
       initial_metadata_add_lb_token(wc_arg->initial_metadata,
                                     wc_arg->lb_token_mdelem_storage,
                                     GRPC_MDELEM_REF(wc_arg->lb_token));
-- 
GitLab