Fix asan failures.

pull/7611/head
Mark D. Roth 8 years ago
parent fcaeb38e8c
commit 2d7387cede
  1. 2
      src/core/ext/client_config/subchannel.h
  2. 4
      src/core/ext/client_config/subchannel_index.c

@ -163,7 +163,7 @@ struct grpc_subchannel_args {
/** Channel arguments to be supplied to the newly created channel */
const grpc_channel_args *args;
/** Server name */
char *server_name; // Does not own.
char *server_name;
/** Address to connect to */
struct sockaddr *addr;
size_t addr_len;

@ -38,6 +38,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/avl.h>
#include <grpc/support/string_util.h>
#include <grpc/support/tls.h>
#include "src/core/lib/channel/channel_args.h"
@ -85,7 +86,7 @@ static grpc_subchannel_key *create_key(
} else {
k->args.filters = NULL;
}
k->args.server_name = args->server_name;
k->args.server_name = gpr_strdup(args->server_name);
k->args.addr_len = args->addr_len;
k->args.addr = gpr_malloc(args->addr_len);
if (k->args.addr_len > 0) {
@ -131,6 +132,7 @@ void grpc_subchannel_key_destroy(grpc_exec_ctx *exec_ctx,
grpc_connector_unref(exec_ctx, k->connector);
gpr_free((grpc_channel_args *)k->args.filters);
grpc_channel_args_destroy((grpc_channel_args *)k->args.args);
gpr_free(k->args.server_name);
gpr_free(k->args.addr);
gpr_free(k);
}

Loading…
Cancel
Save