summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
index 2f119b6ae6..9f8dee2bbe 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
@@ -405,6 +405,7 @@ ShellCommandRunSetVar (
} else {
VariableName = ShellCommandLineGetRawValue (Package, 1);
if (VariableName == NULL) {
+ ShellCommandLineFreeVarList (Package);
return SHELL_INVALID_PARAMETER;
}
@@ -416,6 +417,7 @@ ShellCommandRunSetVar (
RStatus = StrToGuid (StringGuid, &Guid);
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid);
+ ShellCommandLineFreeVarList (Package);
return SHELL_INVALID_PARAMETER;
}
@@ -434,6 +436,7 @@ ShellCommandRunSetVar (
Buffer = AllocateZeroPool (Size);
if (Buffer == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"setvar");
+ ShellCommandLineFreeVarList (Package);
return SHELL_OUT_OF_RESOURCES;
}
@@ -460,6 +463,7 @@ ShellCommandRunSetVar (
Buffer = AllocateZeroPool (Size);
if (Buffer == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"setvar");
+ ShellCommandLineFreeVarList (Package);
return SHELL_OUT_OF_RESOURCES;
}