# HG changeset patch # User smatz # Date 1210181788 0 # Node ID 02dc0c5f36471bdf1437c52f76dfaad9f0ab9a09 # Parent 0b56b6553350f1adab82b5c149b95b9cafa7ee5c (svn r12993) -Fix (r11175): list used for sorting GRFs wasn't freed diff -r 0b56b6553350 -r 02dc0c5f3647 src/newgrf_config.cpp --- a/src/newgrf_config.cpp Wed May 07 15:53:58 2008 +0000 +++ b/src/newgrf_config.cpp Wed May 07 17:36:28 2008 +0000 @@ -406,7 +406,6 @@ * For that we first have to make an array, the qsort and * then remake the linked list. */ GRFConfig **to_sort = MallocT(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 @@ } to_sort[num - 1]->next = NULL; _all_grfs = to_sort[0]; + + free(to_sort); }