summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/s_server.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index 94c18266f7..e3bb1a672d 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2968,8 +2968,10 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
if (context != NULL
&& !SSL_set_session_id_context(con, context,
- strlen((char *)context)))
+ strlen((char *)context))) {
+ SSL_free(con);
goto err;
+ }
sbio = BIO_new_socket(s, BIO_NOCLOSE);
if (s_nbio_test) {
@@ -2981,7 +2983,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
SSL_set_bio(con, sbio, sbio);
SSL_set_accept_state(con);
- /* SSL_set_fd(con,s); */
+ /* No need to free |con| after this. Done by BIO_free(ssl_bio) */
BIO_set_ssl(ssl_bio, con, BIO_CLOSE);
BIO_push(io, ssl_bio);
#ifdef CHARSET_EBCDIC
@@ -3337,6 +3339,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
if (context != NULL
&& !SSL_set_session_id_context(con, context,
strlen((char *)context))) {
+ SSL_free(con);
ERR_print_errors(bio_err);
goto err;
}
@@ -3345,6 +3348,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
SSL_set_bio(con, sbio, sbio);
SSL_set_accept_state(con);
+ /* No need to free |con| after this. Done by BIO_free(ssl_bio) */
BIO_set_ssl(ssl_bio, con, BIO_CLOSE);
BIO_push(io, ssl_bio);
#ifdef CHARSET_EBCDIC