]> code.delx.au - refind/blobdiff - refind/lib.c
Fix memory management error; version 0.6.4 release.
[refind] / refind / lib.c
index 3c9e4c4b66a4d28beb4bb056970cd2ae1cbc66f7..b4d93a8cc03de8ffd72a74f7f429a31758e7fa7d 100644 (file)
@@ -921,15 +921,15 @@ static VOID ScanExtendedPartition(REFIT_VOLUME *WholeDiskVolume, MBR_PARTITION_I
 VOID ScanVolumes(VOID)
 {
     EFI_STATUS              Status;
-    UINTN                   HandleCount = 0;
-    UINTN                   HandleIndex;
     EFI_HANDLE              *Handles;
     REFIT_VOLUME            *Volume, *WholeDiskVolume;
-    UINTN                   VolumeIndex, VolumeIndex2;
     MBR_PARTITION_INFO      *MbrTable;
+    UINTN                   HandleCount = 0;
+    UINTN                   HandleIndex;
+    UINTN                   VolumeIndex, VolumeIndex2;
     UINTN                   PartitionIndex;
-    UINT8                   *SectorBuffer1, *SectorBuffer2;
     UINTN                   SectorSum, i, VolNumber = 0;
+    UINT8                   *SectorBuffer1, *SectorBuffer2;
 
     MyFreePool(Volumes);
     Volumes = NULL;
@@ -951,6 +951,8 @@ VOID ScanVolumes(VOID)
         ScanVolume(Volume);
         if (Volume->IsReadable)
            Volume->VolNumber = VolNumber++;
+        else
+           Volume->VolNumber = VOL_UNREADABLE;
 
         AddListElement((VOID ***) &Volumes, &VolumesCount, Volume);
 
@@ -1638,7 +1640,7 @@ BOOLEAN IsIn(IN CHAR16 *SmallString, IN CHAR16 *List) {
 
 // Implement FreePool the way it should have been done to begin with, so that
 // it doesn't throw an ASSERT message if fed a NULL pointer....
-VOID MyFreePool(IN OUT VOID *Pointer) {
+VOID MyFreePool(IN VOID *Pointer) {
    if (Pointer != NULL)
       FreePool(Pointer);
 }