From 116be91520f533be4ea760938215ba31c519d571 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Mon, 29 Jan 2024 11:41:05 -0800 Subject: [PATCH] fix null config clean-up --- source/s2n/s2n_tls_channel_handler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/s2n/s2n_tls_channel_handler.c b/source/s2n/s2n_tls_channel_handler.c index 01052e8c9..80770b62b 100644 --- a/source/s2n/s2n_tls_channel_handler.c +++ b/source/s2n/s2n_tls_channel_handler.c @@ -1312,8 +1312,9 @@ struct aws_channel_handler *aws_tls_server_handler_new( static void s_s2n_ctx_destroy(struct s2n_ctx *s2n_ctx) { if (s2n_ctx != NULL) { - s2n_config_free(s2n_ctx->s2n_config); - + if (s2n_ctx->s2n_config) { + s2n_config_free(s2n_ctx->s2n_config); + } if (s2n_ctx->custom_cert_chain_and_key) { s2n_cert_chain_and_key_free(s2n_ctx->custom_cert_chain_and_key); }