Mercurial > hg > openttd
changeset 2915:53ad8a24d448 draft
(svn r3470) - Fix: plug a memleak in _network_host_list.
author | Darkvater <Darkvater@openttd.org> |
---|---|
date | Sun, 29 Jan 2006 18:34:43 +0000 |
parents | c616450cd4a0 |
children | 9f16688176a1 |
files | network.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/network.c +++ b/network.c @@ -867,13 +867,16 @@ 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; } }