ArmPlatformPkg: Fixed memory leak after calling GetEnvironmentVariable()

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15428 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c
index ee0301e..8993cb1 100644
--- a/ArmPlatformPkg/Bds/BootOption.c
+++ b/ArmPlatformPkg/Bds/BootOption.c
@@ -86,6 +86,7 @@
                                 (CHAR8*)(LinuxArguments + 1),

                                 FdtDevicePath);

 

+      FreePool (DefaultFdtDevicePath);

       FreePool (FdtDevicePath);

     }

   } else {

diff --git a/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c b/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c
index 6f4b66b..04ad9c0 100644
--- a/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c
+++ b/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c
@@ -118,6 +118,8 @@
     FreePool (RamdiskDevicePath);

   }

 

+  FreePool (FdtDevicePath);

+

   // If we got here we do a confused face because BootLinuxFdt returned,

   // reporting success.

   DEBUG ((EFI_D_ERROR, "WARNING: BdsBootLinuxFdt returned EFI_SUCCESS.\n"));