From b5679ab4ee3aca9c22ff143cfe801bc19bd74e65 Mon Sep 17 00:00:00 2001 From: vincents Date: Sat, 25 Oct 2008 13:31:25 +0000 Subject: [PATCH] lhelp: fixed another memleak git-svn-id: trunk@17132 - --- components/chmhelp/lhelp/chmspecialparser.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/chmhelp/lhelp/chmspecialparser.pas b/components/chmhelp/lhelp/chmspecialparser.pas index f5247bbc93..c3db58801d 100644 --- a/components/chmhelp/lhelp/chmspecialparser.pas +++ b/components/chmhelp/lhelp/chmspecialparser.pas @@ -177,7 +177,12 @@ var fPos: Integer; Line: String; begin - FillChar(Result, SizeOf(Result), 0); + // Don't use fillchar to initialize the result. + // The caller passes a pointer a record which may already contain strings and + // those will not be freed when we clean it with FillChar + Result.Name:=''; + Result.Url:=''; + Result.LineCount:= 0; for X := StartLine to fText.Count-1 do begin Line := fText.Strings[X]; fPos := Pos('