public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [shell] AliasLower never used in InternalSetAlias
@ 2016-10-27 21:11 Tim Lewis
  2016-10-27 21:29 ` Tim Lewis
  0 siblings, 1 reply; 7+ messages in thread
From: Tim Lewis @ 2016-10-27 21:11 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

In the function InternalSetAlias, it appears that AliasLower is duplicated (fromAlias), converted to lower case and freed ,but never actually used. Am I missing something?

  // Convert to lowercase to make aliases case-insensitive
  if (Alias != NULL) {
    AliasLower = AllocateCopyPool (StrSize (Alias), Alias);
    if (AliasLower == NULL) {
      return EFI_OUT_OF_RESOURCES;
    }
    ToLower (AliasLower);
  } else {
    AliasLower = NULL;
  }

  //
  // We must be trying to remove one if Alias is NULL
  //
  if (Alias == NULL) {
    //
    // remove an alias (but passed in COMMAND parameter)
    //
    Status = (gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, NULL));
  } else {
    //
    // Add and replace are the same
    //

    // We dont check the error return on purpose since the variable may not exist.
    gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, NULL);

    Status = (gRT->SetVariable((CHAR16*)Alias, &gShellAliasGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS|(Volatile?0:EFI_VARIABLE_NON_VOLATILE), StrSize(Command), (VOID*)Command));
  }

  if (Alias != NULL) {
    FreePool (AliasLower);
  }


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-28 17:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-27 21:11 [shell] AliasLower never used in InternalSetAlias Tim Lewis
2016-10-27 21:29 ` Tim Lewis
2016-10-28 15:20   ` Carsey, Jaben
2016-10-28 16:48     ` Tim Lewis
2016-10-28 16:58       ` Carsey, Jaben
2016-10-28 17:03         ` Tim Lewis
2016-10-28 17:04           ` Carsey, Jaben

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox