]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Subject: [PATCH 5/9] ShellPkg: Fix memory leak in function'ManBufferFindSections'.
authorQiu Shumin <shumin.qiu@intel.com>
Fri, 25 Dec 2015 01:29:38 +0000 (01:29 +0000)
committershenshushi <shenshushi@Edk2>
Fri, 25 Dec 2015 01:29:38 +0000 (01:29 +0000)
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

ShellPkg/Application/Shell/ShellManParser.c

index 6c1849199c649b6b59cfeba258df0257d10f42ce..222cdafd6ebe71c7bb5d89684d4c140604928621 100644 (file)
@@ -215,6 +215,7 @@ ManBufferFindSections(
         SectionLen = StrLen(SectionName);\r
         SectionName = StrStr(Sections, SectionName);\r
         if (SectionName == NULL) {\r
+          SHELL_FREE_NON_NULL(TempString);\r
           continue;\r
         }\r
         if (*(SectionName + SectionLen) == CHAR_NULL || *(SectionName + SectionLen) == L',') {\r
@@ -250,6 +251,7 @@ ManBufferFindSections(
     }\r
     SHELL_FREE_NON_NULL(TempString);\r
   }\r
+  SHELL_FREE_NON_NULL(TempString);\r
   if (!Found && !EFI_ERROR(Status)) {\r
     return (EFI_NOT_FOUND);\r
   }\r