git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12996
6f19259b-4bc3-4df7-8a09-
765794883524
-* Copyright (c) 2011, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
}
// Update (or Create) the BootOrder environment variable
}
// Update (or Create) the BootOrder environment variable
- Status = gRT->SetVariable (
L"BootOrder",
&gEfiGlobalVariableGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
L"BootOrder",
&gEfiGlobalVariableGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
BootOrder
);
DEBUG((EFI_D_ERROR,"Create %s\n",BootVariableName));
BootOrder
);
DEBUG((EFI_D_ERROR,"Create %s\n",BootVariableName));
+
+ // Free memory allocated by GetEnvironmentVariable
+ if (!EFI_ERROR(Status)) {
+ FreePool (BootOrder);
+ }
} else {
DEBUG((EFI_D_ERROR,"Update %s\n",BootVariableName));
}
} else {
DEBUG((EFI_D_ERROR,"Update %s\n",BootVariableName));
}
}
// Return the first index
return 0;
}
// Return the first index
return 0;