* 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:
marco 2011-06-22 09:25:32 +00:00
parent 0555757247
commit b5c4072af5

View File

@ -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;