(svn r1978) - Fix: Plug some memleaks; thanks Valgrind

This commit is contained in:
Darkvater
2005-03-09 19:48:20 +00:00
parent 9bc68d209f
commit 9bd079d425
7 changed files with 57 additions and 24 deletions

View File

@@ -82,8 +82,7 @@ static void GlobalSortStationList(void)
uint16 *i;
// reset #-of stations to 0 because ++ is used for value-assignment
for (i = _num_station_sort; i != endof(_num_station_sort); i++)
*i = 0;
memset(_num_station_sort, 0, sizeof(_num_station_sort));
/* Create array for sorting */
_station_sort = realloc(_station_sort, GetStationPoolSize() * sizeof(_station_sort[0]));