mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r3470) - Fix: plug a memleak in _network_host_list.
This commit is contained in:
parent
20538e9b40
commit
bb49381cd3
@ -867,13 +867,16 @@ void NetworkRebuildHostList(void)
|
||||
uint i = 0;
|
||||
NetworkGameList *item = _network_game_list;
|
||||
while (item != NULL && i != lengthof(_network_host_list)) {
|
||||
if (item->manually)
|
||||
if (item->manually) {
|
||||
free(_network_host_list[i]);
|
||||
_network_host_list[i++] = str_fmt("%s:%i", item->info.hostname, item->port);
|
||||
}
|
||||
item = item->next;
|
||||
}
|
||||
|
||||
for (; i < lengthof(_network_host_list); i++) {
|
||||
_network_host_list[i] = strdup("");
|
||||
free(_network_host_list[i]);
|
||||
_network_host_list[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user