summaryrefslogtreecommitdiff
path: root/network.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-01-29 18:34:43 +0000
committerDarkvater <darkvater@openttd.org>2006-01-29 18:34:43 +0000
commitbb49381cd3ce8c95e459d1f542fc15064d7b17ea (patch)
treeb2522d1769e6404993ac2ac76701e77da1999437 /network.c
parent20538e9b403349039345369f56b9325704980046 (diff)
downloadopenttd-bb49381cd3ce8c95e459d1f542fc15064d7b17ea.tar.xz
(svn r3470) - Fix: plug a memleak in _network_host_list.
Diffstat (limited to 'network.c')
-rw-r--r--network.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/network.c b/network.c
index c1a0a2238..dfc47abae 100644
--- a/network.c
+++ b/network.c
@@ -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;
}
}