TLS BIO objects (InBio/OutBio) will be freed by SSL_free() function.
So, the following free operation (BIO_free) in TlsFree is redundant.
It can be removed directly.

Cc: Ye Ting <[email protected]>
Cc: Long Qin <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <[email protected]>
---
 CryptoPkg/Library/TlsLib/TlsInit.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/CryptoPkg/Library/TlsLib/TlsInit.c 
b/CryptoPkg/Library/TlsLib/TlsInit.c
index e2c9744..e524647 100644
--- a/CryptoPkg/Library/TlsLib/TlsInit.c
+++ b/CryptoPkg/Library/TlsLib/TlsInit.c
@@ -128,24 +128,16 @@ TlsFree (
   if (TlsConn == NULL) {
     return;
   }
 
   //
-  // Free the internal TLS and BIO objects.
+  // Free the internal TLS and related BIO objects.
   //
   if (TlsConn->Ssl != NULL) {
     SSL_free (TlsConn->Ssl);
   }
 
-  if (TlsConn->InBio != NULL) {
-    BIO_free (TlsConn->InBio);
-  }
-
-  if (TlsConn->OutBio != NULL) {
-    BIO_free (TlsConn->OutBio);
-  }
-
   OPENSSL_free (Tls);
 }
 
 /**
   Create a new TLS object for a connection.
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to