public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Long, Qin" <qin.long@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ye, Ting" <ting.ye@intel.com>, "Wu, Jiaxin" <jiaxin.wu@intel.com>
Subject: Re: [Patch 1/2] CryptoPkg/TlsLib: Remove the redundant free of BIO objects
Date: Mon, 31 Jul 2017 06:04:08 +0000	[thread overview]
Message-ID: <BF2CCE9263284D428840004653A28B6E53FC7697@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1501479637-42288-2-git-send-email-jiaxin.wu@intel.com>

Reviewed-by: Long Qin <qin.long@intel.com>


-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Monday, July 31, 2017 1:41 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Long, Qin <qin.long@intel.com>
Subject: [edk2] [Patch 1/2] CryptoPkg/TlsLib: Remove the redundant free of BIO objects

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 <ting.ye@intel.com>
Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 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
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2017-07-31  6:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31  5:40 [Patch 0/2] Fix the bug when cleaning up the TLS instance Jiaxin Wu
2017-07-31  5:40 ` [Patch 1/2] CryptoPkg/TlsLib: Remove the redundant free of BIO objects Jiaxin Wu
2017-07-31  6:04   ` Long, Qin [this message]
2017-07-31  5:40 ` [Patch 2/2] NetworkPkg/HttpDxe: Destroy the TLS instance when cleaning up the HTTP child Jiaxin Wu
2017-08-01  1:01 ` [Patch 0/2] Fix the bug when cleaning up the TLS instance Fu, Siyuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BF2CCE9263284D428840004653A28B6E53FC7697@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox