From 4afbcc112b666dbebeca54d11bd5f84b814b92ed Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Fri, 25 Dec 2015 01:29:38 +0000 Subject: [PATCH] Subject: [PATCH 5/9] ShellPkg: Fix memory leak in function'ManBufferFindSections'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Yao Jiewen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19525 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/ShellManParser.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- 2.39.2