audk/CryptoPkg/Library/BaseCryptLib
Long Qin 6fe575d052 CryptoPkg/BaseCryptLib: Fix mismatched memory allocation/free
The malloc/free (instead of AllocatePool/FreePool) were used directly
in some wrapper implementations, which was designed to leverage the
light-weight memory management routines at Runtime phase.
The malloc/free and AllocatePool/FreePool usages are required to be
matched, after extra memory size info header was introduced in malloc
wrapper.

This patch corrects two memory allocation cases, which requires the
caller to free the buffer with FreePool() outside the function call.

And some comments were also added to clarify the correct memory
release functions if it's the caller's responsibility to free the
memory buffer.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ting Ye <ting.ye@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2017-11-06 14:51:39 +08:00
..
Cipher CryptoPkg: Fix one wrong parameter for weak key checking 2015-09-02 08:44:46 +00:00
Hash CryptoPkg: Fix typos in comments 2016-11-07 23:21:22 +08:00
Hmac CryptoPkg: Update HMAC Wrapper with opaque HMAC_CTX object. 2017-03-29 16:17:24 +08:00
Pem Enhance error handling code after calling BIO_new in BaseCryptLib. 2013-08-07 08:11:14 +00:00
Pk CryptoPkg/BaseCryptLib: Fix mismatched memory allocation/free 2017-11-06 14:51:39 +08:00
Rand CryptoPkg: Fix typos in comments 2016-11-07 23:21:22 +08:00
SysCall CryptoPkg/BaseCryptLib: Fix buffer overflow issue in realloc wrapper 2017-11-06 14:50:17 +08:00
BaseCryptLib.inf CryptoPkg: Add extra build option to disable VS build warning 2017-03-29 16:15:19 +08:00
BaseCryptLib.uni CryptoPkg: Convert all .uni files to utf-8 2015-12-15 04:51:26 +00:00
InternalCryptLib.h CryptoPkg: Add extra build option to disable VS build warning 2017-03-29 16:15:19 +08:00
PeiCryptLib.inf CryptoPkg/BaseCryptLib: Fix Build Warning issue in PEI Module 2017-03-30 16:00:51 +08:00
PeiCryptLib.uni CryptoPkg: Convert all .uni files to utf-8 2015-12-15 04:51:26 +00:00
RuntimeCryptLib.inf CryptoPkg: Add extra build option to disable VS build warning 2017-03-29 16:15:19 +08:00
RuntimeCryptLib.uni CryptoPkg: Convert all .uni files to utf-8 2015-12-15 04:51:26 +00:00
SmmCryptLib.inf CryptoPkg/SmmCryptLib: Enable HMAC-SHA256 support for SMM. 2017-05-02 08:59:57 +08:00
SmmCryptLib.uni CryptoPkg: Convert all .uni files to utf-8 2015-12-15 04:51:26 +00:00