summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorCelestar <Celestar@openttd.org>2005-03-08 16:27:26 +0000
committerCelestar <Celestar@openttd.org>2005-03-08 16:27:26 +0000
commit79b2a245e691699d5d818bc1860a542cc9160198 (patch)
treea230f8e2382f895c7a16d78755e7954950493e47 /train_cmd.c
parent99499094a9793224858362b31ce82644193d51a5 (diff)
downloadopenttd-79b2a245e691699d5d818bc1860a542cc9160198.tar.xz
(svn r1959) -Fix: Repaired two memleaks I have hacked :(
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 5aa0ed2bc..683022538 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -131,6 +131,9 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
sum += dist[i];
}
+ free(dist);
+ dist = NULL;
+
if (numcurve > 0) {
sum /= numcurve;
}