mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-20 21:19:10 +00:00
(svn r3469) - Fix: plug a possible memleak with subsequential strdup's without freeing the previous value and make it possible to ban offline clients
This commit is contained in:
@@ -1068,7 +1068,7 @@ static void ClientList_Ban(byte client_no)
|
||||
uint32 ip = NetworkFindClientInfo(client_no)->client_ip;
|
||||
|
||||
for (i = 0; i < lengthof(_network_ban_list); i++) {
|
||||
if (_network_ban_list[i] == NULL || _network_ban_list[i][0] == '\0') {
|
||||
if (_network_ban_list[i] == NULL) {
|
||||
_network_ban_list[i] = strdup(inet_ntoa(*(struct in_addr *)&ip));
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user