# HG changeset patch # User Darkvater # Date 1138559683 0 # Node ID 53ad8a24d44860c648d155c64d3becce49787148 # Parent c616450cd4a0c603a96b0635ef8b2754c58bcd16 (svn r3470) - Fix: plug a memleak in _network_host_list. diff --git a/network.c b/network.c --- 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; } }