Skip to content

Commit

Permalink
release alpn string before set
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Aug 2, 2023
1 parent f7bc831 commit 39e2a21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/tls_channel_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ int aws_tls_ctx_options_init_default_server(
}

int aws_tls_ctx_options_set_alpn_list(struct aws_tls_ctx_options *options, const char *alpn_list) {
if (options->alpn_list != NULL) {
aws_string_destroy(options->alpn_list);
options->alpn_list = NULL;
}

options->alpn_list = aws_string_new_from_c_str(options->allocator, alpn_list);
if (!options->alpn_list) {
return AWS_OP_ERR;
Expand Down

0 comments on commit 39e2a21

Please sign in to comment.