mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 01:50:26 +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
|
begin
|
||||||
sitemap.free;
|
sitemap.free;
|
||||||
Result:=AbortAndTryTextual;
|
Result:=AbortAndTryTextual;
|
||||||
end;
|
end
|
||||||
|
else Index.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChmReader.GetTOCSitemap(ForceXML:boolean=false): TChmSiteMap;
|
function TChmReader.GetTOCSitemap(ForceXML:boolean=false): TChmSiteMap;
|
||||||
@ -1289,10 +1290,17 @@ begin
|
|||||||
EntryCount := NtoLE(TOC.ReadDWord);
|
EntryCount := NtoLE(TOC.ReadDWord);
|
||||||
TOPICSOffset := NtoLE(TOC.ReadDWord);
|
TOPICSOffset := NtoLE(TOC.ReadDWord);
|
||||||
|
|
||||||
|
if EntryCount <> 0 then
|
||||||
|
begin
|
||||||
|
Toc.Free;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
NextItem := EntryInfoOffset;
|
NextItem := EntryInfoOffset;
|
||||||
repeat
|
repeat
|
||||||
NextItem := AddTOCItem(Toc, NextItem, Result.Items);
|
NextItem := AddTOCItem(Toc, NextItem, Result.Items);
|
||||||
until NextItem = 0;
|
until NextItem = 0;
|
||||||
|
TOC.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChmReader.HasContextList: Boolean;
|
function TChmReader.HasContextList: Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user