summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26a9499)
raw | patch | inline | side by side (parent: 26a9499)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 8 Apr 2016 19:34:50 +0000 (22:34 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 8 Apr 2016 19:34:50 +0000 (22:34 +0300) |
src/shared/WADEDITOR.pas | patch | blob | history |
index de670694b81fe44207506b355c7351b3921ea86c..0a80f51d4d43091f3be64900719c3180a498e588 100644 (file)
--- a/src/shared/WADEDITOR.pas
+++ b/src/shared/WADEDITOR.pas
f: Integer;
fi: TSFSFileInfo;
fs: TStream;
+ fpp: Pointer;
//fn: string;
begin
Result := False;
end;
Len := Integer(fs.size);
GetMem(pData, Len);
- fs.ReadBuffer(pData^, Len);
- fs.Free;
+ fpp := pData;
+ try
+ fs.ReadBuffer(pData^, Len);
+ fpp := nil;
+ finally
+ if fpp <> nil then
+ begin
+ FreeMem(fpp);
+ pData := nil;
+ Len := 0;
+ end;
+ fs.Free;
+ end;
result := true;
{$IFDEF SFS_DWFAD_DEBUG}
if gSFSDebug then