mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 10:19:30 +02:00
* fixed two memleaks in chmreader. Patch based on the one in Mantis #19599 by Anton
git-svn-id: trunk@17791 -
This commit is contained in:
parent
0555757247
commit
b5c4072af5
@ -1205,7 +1205,8 @@ begin
|
||||
begin
|
||||
sitemap.free;
|
||||
Result:=AbortAndTryTextual;
|
||||
end;
|
||||
end
|
||||
else Index.Free;
|
||||
end;
|
||||
|
||||
function TChmReader.GetTOCSitemap(ForceXML:boolean=false): TChmSiteMap;
|
||||
@ -1281,7 +1282,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
// Binary Toc Exists
|
||||
// Binary Toc Exists
|
||||
Result := TChmSiteMap.Create(stTOC);
|
||||
|
||||
EntryInfoOffset := NtoLE(TOC.ReadDWord);
|
||||
@ -1289,10 +1290,17 @@ begin
|
||||
EntryCount := NtoLE(TOC.ReadDWord);
|
||||
TOPICSOffset := NtoLE(TOC.ReadDWord);
|
||||
|
||||
if EntryCount <> 0 then
|
||||
begin
|
||||
Toc.Free;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
NextItem := EntryInfoOffset;
|
||||
repeat
|
||||
NextItem := AddTOCItem(Toc, NextItem, Result.Items);
|
||||
until NextItem = 0;
|
||||
TOC.Free;
|
||||
end;
|
||||
|
||||
function TChmReader.HasContextList: Boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user