aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/lb_policy/grpclb
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-11-21 21:52:47 -0800
committerGravatar David Garcia Quintas <dgq@google.com>2016-11-21 21:52:47 -0800
commit1ebcaa2f547d4f38319c4125380dc4ee93a3f3f2 (patch)
tree1c4c16506fc220de23a2d7faf73da037fc1e93fe /src/core/ext/lb_policy/grpclb
parent2ef2d2a516344f3f46858e8badda842ee6a69d18 (diff)
Fixed leak upon duped serverlist updates
Diffstat (limited to 'src/core/ext/lb_policy/grpclb')
-rw-r--r--src/core/ext/lb_policy/grpclb/grpclb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c
index 0829e05b43..6132ccaf78 100644
--- a/src/core/ext/lb_policy/grpclb/grpclb.c
+++ b/src/core/ext/lb_policy/grpclb/grpclb.c
@@ -1238,12 +1238,15 @@ static void lb_on_response_received(grpc_exec_ctx *exec_ctx, void *arg,
gpr_log(GPR_INFO,
"Incoming server list identical to current, ignoring.");
}
+ grpc_grpclb_destroy_serverlist(serverlist);
} else { /* new serverlist */
if (glb_policy->serverlist != NULL) {
/* dispose of the old serverlist */
grpc_grpclb_destroy_serverlist(glb_policy->serverlist);
}
- /* and update the copy in the glb_lb_policy instance */
+ /* and update the copy in the glb_lb_policy instance. This serverlist
+ * instance will be destroyed either upon the next update or in
+ * glb_destroy() */
glb_policy->serverlist = serverlist;
rr_handover_locked(exec_ctx, glb_policy);