mirror of https://github.com/OpenTTD/OpenTTD
(svn r1959) -Fix: Repaired two memleaks I have hacked :(
parent
bcc9dcd210
commit
7473cef063
|
@ -1697,8 +1697,11 @@ void OnNewDay_RoadVeh(Vehicle *v)
|
||||||
//We do not have a slot, so make one
|
//We do not have a slot, so make one
|
||||||
if (v->u.road.slot == NULL) {
|
if (v->u.road.slot == NULL) {
|
||||||
//first we need to find out how far our stations are away.
|
//first we need to find out how far our stations are away.
|
||||||
if ( rs == NULL )
|
if ( rs == NULL ) {
|
||||||
|
free(firststop);
|
||||||
|
firststop = stop = NULL;
|
||||||
goto no_stop;
|
goto no_stop;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG(ms, 2) ("Multistop: Attempting to obtain a slot for vehicle %d at station %d (0x%x)", v->unitnumber, st->index, st->xy);
|
DEBUG(ms, 2) ("Multistop: Attempting to obtain a slot for vehicle %d at station %d (0x%x)", v->unitnumber, st->index, st->xy);
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -131,6 +131,9 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
|
||||||
sum += dist[i];
|
sum += dist[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(dist);
|
||||||
|
dist = NULL;
|
||||||
|
|
||||||
if (numcurve > 0) {
|
if (numcurve > 0) {
|
||||||
sum /= numcurve;
|
sum /= numcurve;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue