aboutsummaryrefslogtreecommitdiff
path: root/demos/bio/sconnect.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/bio/sconnect.c')
-rw-r--r--demos/bio/sconnect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/demos/bio/sconnect.c b/demos/bio/sconnect.c
index 18f7007ce708..27d5a9eca7a7 100644
--- a/demos/bio/sconnect.c
+++ b/demos/bio/sconnect.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2025 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -69,8 +69,10 @@ int main(int argc, char *argv[])
/* The BIO has parsed the host:port and even IPv6 literals in [] */
hostname = BIO_get_conn_hostname(out);
- if (!hostname || SSL_set1_host(ssl, hostname) <= 0)
+ if (!hostname || SSL_set1_host(ssl, hostname) <= 0) {
+ BIO_free(ssl_bio);
goto err;
+ }
BIO_set_nbio(out, 1);
out = BIO_push(ssl_bio, out);