diff options
author | Pauli <pauli@openssl.org> | 2021-06-25 12:55:28 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-06-26 11:33:52 +1000 |
commit | 1f3f8a3d016ac1c659f7201e152c291d03437b72 (patch) | |
tree | feaa5deef8bc773b69d167cac07496d2017176b5 /apps/s_server.c | |
parent | 150251904c2b4c2cffd7429af90cd0486e3682d7 (diff) |
apps: address potential memory leaks
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15910)
Diffstat (limited to 'apps/s_server.c')
-rw-r--r-- | apps/s_server.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/s_server.c b/apps/s_server.c index 9c0c467ed6..a112b01f1b 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -3016,6 +3016,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context) /* 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); + ssl_bio = NULL; #ifdef CHARSET_EBCDIC io = BIO_push(BIO_new(BIO_f_ebcdic_filter()), io); #endif @@ -3376,6 +3377,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context) err: OPENSSL_free(buf); + BIO_free(ssl_bio); BIO_free_all(io); return ret; } @@ -3420,6 +3422,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context) /* 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); + ssl_bio = NULL; #ifdef CHARSET_EBCDIC io = BIO_push(BIO_new(BIO_f_ebcdic_filter()), io); #endif @@ -3517,6 +3520,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context) err: OPENSSL_free(buf); + BIO_free(ssl_bio); BIO_free_all(io); return ret; } |