Skip to content

Commit

Permalink
Fix: release alpn string before set for tls_ctx_options (#588)
Browse files Browse the repository at this point in the history
* release alpn string before set

* Update source/tls_channel_handler.c

Co-authored-by: Dengke Tang <[email protected]>

* clang-format

---------

Co-authored-by: Dengke Tang <[email protected]>
  • Loading branch information
xiazhvera and TingDaoK authored Aug 3, 2023
1 parent f7bc831 commit a3555c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/tls_channel_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ 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) {
aws_string_destroy(options->alpn_list);

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 a3555c8

Please sign in to comment.