Reviewed by: jiewen@intel.com
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu
Shumin
Sent: Thursday, December 24, 2015 2:10 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Carsey, Jaben; Qiu, Shumin; Yao, Jiewen
Subject: [edk2] [PATCH v2 1/2] ShellPkg: Fix memory leak in function
'ManBufferFindSections'.
Cc: Yao Jiewen <jiewen@intel.com>
Cc: Ruiyu Ni <ruiyu...@intel.com>
Cc: Jaben Carsey <jaben.car...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin@intel.com>
---
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 6c18491..222cdaf 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);
}
--
1.9.5.msysgit.1
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel