Skip to content
Snippets Groups Projects
Commit 2d7387ce authored by Mark D. Roth's avatar Mark D. Roth
Browse files

Fix asan failures.

parent fcaeb38e
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment