1
0
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:
Darkvater
2006-01-29 18:04:52 +00:00
parent 2de4331931
commit 20538e9b40
2 changed files with 28 additions and 22 deletions

View File

@@ -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;
}