audk/MdeModulePkg/Universal/RegularExpressionDxe
Laszlo Ersek ffbb5ae3ba MdeModulePkg: RegularExpressionDxe: support free(NULL)
The ISO C standard says about free(),

  If ptr is a null pointer, no action occurs.

This is not true of the FreePool() interface of the MemoryAllocationLib
class:

  Buffer must have been allocated on a previous call to the pool
  allocation services of the Memory Allocation Library. [...] If Buffer
  was not allocated with a pool allocation function in the Memory
  Allocation Library, then ASSERT().

Therefore we must not forward the argument of free() to FreePool() without
checking.

Cc: Cecil Sheng <cecil.sheng@hpe.com>
Cc: Cinnamon Shia <cinnamon.shia@hpe.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Cc: Yao Jiewen <Jiewen.Yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-By: Cinnamon Shia <cinnamon.shia@hpe.com>
2016-02-26 18:30:14 +01:00
..
Oniguruma MdeModulePkg: RegularExpressionDxe: support free(NULL) 2016-02-26 18:30:14 +01:00
RegularExpressionDxe.c MdeModulePkg: Add NULL pointer check for RegularExpressionDxe. 2015-12-15 08:40:55 +00:00
RegularExpressionDxe.h MdeModulePkg/RegularExpressionDxe: Correct copyright 2015-11-03 02:43:03 +00:00
RegularExpressionDxe.inf MdeModulePkg/RegularExpressionDxe: Add missing PrintLib 2015-11-03 02:44:48 +00:00