diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2015-12-25 01:29:38 +0000 |
---|---|---|
committer | shenshushi <shenshushi@Edk2> | 2015-12-25 01:29:38 +0000 |
commit | 4afbcc112b666dbebeca54d11bd5f84b814b92ed (patch) | |
tree | ba4d022ea4d0ceda4cb67ece0f041dfa1c0543f1 /ShellPkg | |
parent | dd17e3feb7080e174ed540d9d85ad2fb56bc669b (diff) | |
download | edk2-4afbcc112b666dbebeca54d11bd5f84b814b92ed.tar.gz edk2-4afbcc112b666dbebeca54d11bd5f84b814b92ed.tar.bz2 edk2-4afbcc112b666dbebeca54d11bd5f84b814b92ed.zip |
Subject: [PATCH 5/9] ShellPkg: Fix memory leak in function'ManBufferFindSections'.
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/trunk/edk2@19525 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Application/Shell/ShellManParser.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c index 6c1849199c..222cdafd6e 100644 --- a/ShellPkg/Application/Shell/ShellManParser.c +++ b/ShellPkg/Application/Shell/ShellManParser.c @@ -215,6 +215,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',') {
@@ -250,6 +251,7 @@ ManBufferFindSections( }
SHELL_FREE_NON_NULL(TempString);
}
+ SHELL_FREE_NON_NULL(TempString);
if (!Found && !EFI_ERROR(Status)) {
return (EFI_NOT_FOUND);
}
|