From: Jiaxin Wu <jiaxin.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting.ye@intel.com>, Long Qin <qin.long@intel.com>,
Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 1/2] CryptoPkg/TlsLib: Remove the redundant free of BIO objects
Date: Mon, 31 Jul 2017 13:40:36 +0800 [thread overview]
Message-ID: <1501479637-42288-2-git-send-email-jiaxin.wu@intel.com> (raw)
In-Reply-To: <1501479637-42288-1-git-send-email-jiaxin.wu@intel.com>
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
next prev parent reply other threads:[~2017-07-31 5:38 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 ` Jiaxin Wu [this message]
2017-07-31 6:04 ` [Patch 1/2] CryptoPkg/TlsLib: Remove the redundant free of BIO objects Long, Qin
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=1501479637-42288-2-git-send-email-jiaxin.wu@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