QcomModulePkg: Update AllocatePool api with AllocateZeroPool
As an uninitialized buffer may cause an unexpected behavior, we
need to update "AllocatePool" api with "AllocateZeroPool" to
initialize the buffer to zero before using it.
Change-Id: I917c97c8861592fedabaaf8379c5229293a1b255
diff --git a/QcomModulePkg/Library/BootLib/Board.c b/QcomModulePkg/Library/BootLib/Board.c
index 0f7503d..7b8329a 100644
--- a/QcomModulePkg/Library/BootLib/Board.c
+++ b/QcomModulePkg/Library/BootLib/Board.c
@@ -59,7 +59,8 @@
Status = pRamPartProtocol->GetRamPartitions (pRamPartProtocol, NULL,
NumPartitions);
if (Status == EFI_BUFFER_TOO_SMALL) {
- *RamPartitions = AllocatePool (*NumPartitions * sizeof (RamPartitionEntry));
+ *RamPartitions = AllocateZeroPool (
+ *NumPartitions * sizeof (RamPartitionEntry));
if (*RamPartitions == NULL)
return EFI_OUT_OF_RESOURCES;