mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 18:09:15 +02:00
* Fix bug ID #27617, heap messed up due to not resetting pointer
git-svn-id: trunk@30368 -
This commit is contained in:
parent
910a88122f
commit
9bf410e6a0
@ -35,11 +35,11 @@ var
|
|||||||
num_leaps,
|
num_leaps,
|
||||||
num_types : longint;
|
num_types : longint;
|
||||||
|
|
||||||
transitions : plongint;
|
transitions : plongint = nil;
|
||||||
type_idxs : pbyte;
|
type_idxs : pbyte = Nil;
|
||||||
types : pttinfo;
|
types : pttinfo = Nil;
|
||||||
zone_names : pchar;
|
zone_names : pchar = Nil;
|
||||||
leaps : pleap;
|
leaps : pleap = Nil;
|
||||||
|
|
||||||
function find_transition(timer:longint):pttinfo;
|
function find_transition(timer:longint):pttinfo;
|
||||||
var
|
var
|
||||||
@ -217,7 +217,7 @@ begin
|
|||||||
num_transitions:=tzhead.tzh_timecnt;
|
num_transitions:=tzhead.tzh_timecnt;
|
||||||
num_types:=tzhead.tzh_typecnt;
|
num_types:=tzhead.tzh_typecnt;
|
||||||
chars:=tzhead.tzh_charcnt;
|
chars:=tzhead.tzh_charcnt;
|
||||||
|
num_leaps:=tzhead.tzh_leapcnt;
|
||||||
reallocmem(transitions,num_transitions*sizeof(longint));
|
reallocmem(transitions,num_transitions*sizeof(longint));
|
||||||
reallocmem(type_idxs,num_transitions);
|
reallocmem(type_idxs,num_transitions);
|
||||||
reallocmem(types,num_types*sizeof(tttinfo));
|
reallocmem(types,num_types*sizeof(tttinfo));
|
||||||
@ -323,14 +323,19 @@ procedure DoneLocalTime;
|
|||||||
begin
|
begin
|
||||||
if assigned(transitions) then
|
if assigned(transitions) then
|
||||||
freemem(transitions);
|
freemem(transitions);
|
||||||
|
transitions:=nil;
|
||||||
if assigned(type_idxs) then
|
if assigned(type_idxs) then
|
||||||
freemem(type_idxs);
|
freemem(type_idxs);
|
||||||
|
type_idxs:=nil;
|
||||||
if assigned(types) then
|
if assigned(types) then
|
||||||
freemem(types);
|
freemem(types);
|
||||||
|
types:=nil;
|
||||||
if assigned(zone_names) then
|
if assigned(zone_names) then
|
||||||
freemem(zone_names);
|
freemem(zone_names);
|
||||||
|
zone_names:=Nil;
|
||||||
if assigned(leaps) then
|
if assigned(leaps) then
|
||||||
freemem(leaps);
|
freemem(leaps);
|
||||||
|
leaps:=nil;
|
||||||
num_transitions:=0;
|
num_transitions:=0;
|
||||||
num_leaps:=0;
|
num_leaps:=0;
|
||||||
num_types:=0;
|
num_types:=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user