From 16057b01349f75003583e6f522cc202f61c22588 Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Fri, 25 Dec 2015 02:14:05 +0000 Subject: 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 Reviewed-by: Yao Jiewen git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19537 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/ShellManParser.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ShellPkg') 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); } -- cgit v1.2.3