summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-05-07 17:36:28 +0000
committersmatz <smatz@openttd.org>2008-05-07 17:36:28 +0000
commitc3822e3a90ca1b00878ebcc3efb6134ab6373545 (patch)
treef64c5f9621db27acf38f07919c19dfa475c520de /src/newgrf_config.cpp
parent0c4715d8256a875249fab2389dd19cd437e4e97b (diff)
downloadopenttd-c3822e3a90ca1b00878ebcc3efb6134ab6373545.tar.xz
(svn r12993) -Fix (r11175): list used for sorting GRFs wasn't freed
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index f562fb6d2..903ad7fb3 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -406,7 +406,6 @@ void ScanNewGRFFiles()
* For that we first have to make an array, the qsort and
* then remake the linked list. */
GRFConfig **to_sort = MallocT<GRFConfig*>(num);
- if (to_sort == NULL) return; // No memory, then don't sort
uint i = 0;
for (GRFConfig *p = _all_grfs; p != NULL; p = p->next, i++) {
@@ -422,6 +421,8 @@ void ScanNewGRFFiles()
}
to_sort[num - 1]->next = NULL;
_all_grfs = to_sort[0];
+
+ free(to_sort);
}