aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/demos/bio/server-cmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/demos/bio/server-cmod.c')
-rw-r--r--crypto/openssl/demos/bio/server-cmod.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/openssl/demos/bio/server-cmod.c b/crypto/openssl/demos/bio/server-cmod.c
index 3642fbacf6ce..4970a6b6466b 100644
--- a/crypto/openssl/demos/bio/server-cmod.c
+++ b/crypto/openssl/demos/bio/server-cmod.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-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
@@ -24,7 +24,8 @@ int main(int argc, char *argv[])
unsigned char buf[512];
char *port = "*:4433";
BIO *in = NULL;
- BIO *ssl_bio, *tmp;
+ BIO *ssl_bio = NULL;
+ BIO *tmp;
SSL_CTX *ctx;
int ret = EXIT_FAILURE, i;
@@ -52,6 +53,7 @@ int main(int argc, char *argv[])
* Basically it means the SSL BIO will be automatically setup
*/
BIO_set_accept_bios(in, ssl_bio);
+ ssl_bio = NULL;
again:
/*
@@ -90,5 +92,6 @@ int main(int argc, char *argv[])
if (ret != EXIT_SUCCESS)
ERR_print_errors_fp(stderr);
BIO_free(in);
+ BIO_free_all(ssl_bio);
return ret;
}