RR: Don't copy user_data is no vtable

pull/8611/head
David Garcia Quintas 8 years ago
parent 11948f7441
commit 5bdcd237fc
  1. 6
      src/core/ext/lb_policy/round_robin/round_robin.c

@ -678,8 +678,10 @@ static grpc_lb_policy *round_robin_create(grpc_exec_ctx *exec_ctx,
sd->index = subchannel_idx;
sd->subchannel = subchannel;
sd->user_data_vtable = addresses->user_data_vtable;
sd->user_data =
sd->user_data_vtable->copy(addresses->addresses[i].user_data);
if (sd->user_data_vtable != NULL) {
sd->user_data =
sd->user_data_vtable->copy(addresses->addresses[i].user_data);
}
++subchannel_idx;
grpc_closure_init(&sd->connectivity_changed_closure,
rr_connectivity_changed, sd);

Loading…
Cancel
Save