diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-11-13 16:08:52 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-11-13 16:08:52 +0000 |
commit | 3f869579a47a0c48119e256a5309526f41092812 (patch) | |
tree | d9c659cf6bdd7299875235b094ee381895298698 /ShellPkg/Application | |
parent | bad73446684b9528c7e14ca1a372ac89c7af15bb (diff) | |
download | edk2-platforms-3f869579a47a0c48119e256a5309526f41092812.tar.xz |
ShellPkg: Correct 3 places where memory was not being properly released by the shell.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Liu, Jiang A <jiang.a.liu@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13938 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Application')
-rw-r--r-- | ShellPkg/Application/Shell/ShellEnvVar.c | 2 | ||||
-rw-r--r-- | ShellPkg/Application/Shell/ShellParametersProtocol.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/ShellEnvVar.c b/ShellPkg/Application/Shell/ShellEnvVar.c index a4bd6a6179..6634c6951a 100644 --- a/ShellPkg/Application/Shell/ShellEnvVar.c +++ b/ShellPkg/Application/Shell/ShellEnvVar.c @@ -105,7 +105,7 @@ FreeEnvironmentVariableList( }
for ( Node = (ENV_VAR_LIST*)GetFirstNode(List)
- ; IsListEmpty(List)
+ ; !IsListEmpty(List)
; Node = (ENV_VAR_LIST*)GetFirstNode(List)
){
ASSERT(Node != NULL);
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c index e152a7a3a0..9ce7e92605 100644 --- a/ShellPkg/Application/Shell/ShellParametersProtocol.c +++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c @@ -192,6 +192,7 @@ ParseCommandLineToArgs( //
(*Argv) = AllocateZeroPool((Count)*sizeof(CHAR16*));
if (*Argv == NULL) {
+ SHELL_FREE_NON_NULL(TempParameter);
return (EFI_OUT_OF_RESOURCES);
}
@@ -207,6 +208,7 @@ ParseCommandLineToArgs( (*Argc)++;
}
ASSERT(Count >= (*Argc));
+ SHELL_FREE_NON_NULL(TempParameter);
return (EFI_SUCCESS);
}
|