summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2015-12-25 02:14:05 +0000
committerhwu1225 <hwu1225@Edk2>2015-12-25 02:14:05 +0000
commit16057b01349f75003583e6f522cc202f61c22588 (patch)
tree1859c55668d0a1530b3f4941dcac0fe2d6325da5 /ShellPkg
parentd291c4b327ca65b1d5f22efe9b4cf86c9bc08962 (diff)
downloadedk2-platforms-16057b01349f75003583e6f522cc202f61c22588.tar.xz
Subject: [PATCH 5/9] ShellPkg: Fix memory leak in function'ManBufferFindSections'.
(Sync patch r19525 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19537 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/ShellManParser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c
index f12775f865..80028a6216 100644
--- a/ShellPkg/Application/Shell/ShellManParser.c
+++ b/ShellPkg/Application/Shell/ShellManParser.c
@@ -196,6 +196,7 @@ ManBufferFindSections(
SectionLen = StrLen(SectionName);
SectionName = StrStr(Sections, SectionName);
if (SectionName == NULL) {
+ SHELL_FREE_NON_NULL(TempString);
continue;
}
if (*(SectionName + SectionLen) == CHAR_NULL || *(SectionName + SectionLen) == L',') {
@@ -231,6 +232,7 @@ ManBufferFindSections(
}
SHELL_FREE_NON_NULL(TempString);
}
+ SHELL_FREE_NON_NULL(TempString);
if (!Found && !EFI_ERROR(Status)) {
return (EFI_NOT_FOUND);
}