Преглед изворни кода

Merge /u/xypron/gnu-efi/ branch misc_fixes into master

https://sourceforge.net/p/gnu-efi/code/merge-requests/22/
b'Nigel Croxon пре 3 година
родитељ
комит
2a7829c50b
3 измењених фајлова са 8 додато и 6 уклоњено
  1. 3 1
      lib/hand.c
  2. 4 4
      lib/misc.c
  3. 1 1
      lib/str.c

+ 3 - 1
lib/hand.c

@@ -610,6 +610,7 @@ LibReinstallProtocolInterfaces (
 
         Index += 1;
     }
+    va_end (args);
 
     //
     // If there was an error, undo all the interfaces that were
@@ -627,7 +628,8 @@ LibReinstallProtocolInterfaces (
             uefi_call_wrapper(BS->ReinstallProtocolInterface, 4, Handle, Protocol, NewInterface, OldInterface);
 
             Index -= 1;
-        }        
+        }
+        va_end (args);
     }
 
     //

+ 4 - 4
lib/misc.c

@@ -386,7 +386,9 @@ LibInsertToTailOfBootOrder (
 
     VarSize += sizeof(UINT16);
     NewBootOptionArray = AllocatePool (VarSize);
-    
+    if (!NewBootOptionArray)
+        return EFI_OUT_OF_RESOURCES;
+
     for (Index = 0; Index < ((VarSize/sizeof(UINT16)) - 1); Index++) {
         NewBootOptionArray[Index] = BootOptionArray[Index];
     }
@@ -403,9 +405,7 @@ LibInsertToTailOfBootOrder (
                 VarSize, (VOID*) NewBootOptionArray
                 );
 
-    if (NewBootOptionArray) {
-        FreePool (NewBootOptionArray);
-    }
+    FreePool (NewBootOptionArray);
     if (BootOptionArray) {
         FreePool (BootOptionArray);
     }

+ 1 - 1
lib/str.c

@@ -305,7 +305,7 @@ Atoi (
     CHAR16      c;
 
     // skip preceeding white space
-    while (*str && *str == ' ') {
+    while (*str == ' ') {
         str += 1;
     }