diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c index ffacd41cf91d7..0ab1f0494c07b 100644 --- a/ssl/statem/extensions.c +++ b/ssl/statem/extensions.c @@ -875,8 +875,8 @@ static int init_alpn(SSL *s, unsigned int context) { OPENSSL_free(s->s3->alpn_selected); s->s3->alpn_selected = NULL; + s->s3->alpn_selected_len = 0; if (s->server) { - s->s3->alpn_selected_len = 0; OPENSSL_free(s->s3->alpn_proposed); s->s3->alpn_proposed = NULL; s->s3->alpn_proposed_len = 0;