From a3555c86bd10149a1ab0c1b2810756ec54cfbe3a Mon Sep 17 00:00:00 2001 From: xiazhvera Date: Thu, 3 Aug 2023 00:04:22 -0700 Subject: [PATCH] Fix: release alpn string before set for tls_ctx_options (#588) * release alpn string before set * Update source/tls_channel_handler.c Co-authored-by: Dengke Tang * clang-format --------- Co-authored-by: Dengke Tang --- source/tls_channel_handler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/tls_channel_handler.c b/source/tls_channel_handler.c index aa80459b7..83955def1 100644 --- a/source/tls_channel_handler.c +++ b/source/tls_channel_handler.c @@ -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;