diff options
author | Wei6 Xu <wei6.xu@intel.com> | 2023-10-30 11:07:13 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-12-19 09:29:07 +0000 |
commit | 0904161f6f051b9f42ffa65b1f9aa4a5b29e2119 (patch) | |
tree | 7e4a416061de3cbb3629e445f37ae741fe6fbe68 /BaseTools/Source/Python/AutoGen/IdfClassObject.py | |
parent | c0122840489194215a9209bb37f406f44c416953 (diff) | |
download | edk2-0904161f6f051b9f42ffa65b1f9aa4a5b29e2119.tar.gz edk2-0904161f6f051b9f42ffa65b1f9aa4a5b29e2119.tar.bz2 edk2-0904161f6f051b9f42ffa65b1f9aa4a5b29e2119.zip |
StandaloneMmPkg/Core: Fix potential memory leak issue
In MmCoreFfsFindMmDriver(),
- ScratchBuffer is not freed in the error return path that DstBuffer page
allocation fails. Free ScratchBuffer before return with error.
- If the decoded buffer is identical to the data in InputSection,
ExtractGuidedSectionDecode() will change the value of DstBuffer rather
than changing the contents of the buffer that DstBuffer points at, in
which case freeing DstBuffer is wrong. Introduce a local variable
AllocatedDstBuffer for buffer free, free AllocatedDstBuffer immediately
if it is not used.
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/IdfClassObject.py')
0 files changed, 0 insertions, 0 deletions