SSLi_hash2hex(ban->hash, hexhash);
+ char *clientAddressString = Util_clientAddressToString(client);
+
Log_info_client(client, "User kickbanned. Reason: '%s' Hash: %s IP: %s Banned for: %d seconds",
- ban->reason, hexhash, Util_clientAddressToString(client), ban->duration);
+ ban->reason, hexhash, clientAddressString, ban->duration);
+
+ free(clientAddressString);
}
if (memcmp(itraddress, fromaddress, addresslength) == 0) {
if (checkDecrypt(itr, encrypted, buffer, len)) {
memcpy(itr->key, key, KEY_LENGTH);
- Log_info_client(itr, "New UDP connection from %s on port %d", Util_clientAddressToString(itr), fromport);
+ char* clientAddressString = Util_clientAddressToString(itr);
+ Log_info_client(itr, "New UDP connection from %s on port %d", clientAddressString, fromport);
+ free(clientAddressString);
memcpy(&itr->remote_udp, &from, sizeof(struct sockaddr_storage));
break;
}
itr->bUDP = true;
len -= 4; /* Adjust for crypt header */
msgType = (UDPMessageType_t)((buffer[0] >> 5) & 0x7);
+
+ char *clientAddressString = NULL;
+
switch (msgType) {
case UDPVoiceSpeex:
case UDPVoiceCELTAlpha:
Client_send_udp(itr, buffer, len);
break;
default:
- Log_debug("Unknown UDP message type from %s port %d", Util_clientAddressToString(itr), fromport);
+ clientAddressString = Util_clientAddressToString(itr);
+ Log_debug("Unknown UDP message type from %s port %d", clientAddressString, fromport);
+ free(clientAddressString);
break;
}
offset += vsnprintf(&buf[offset], STRSIZE - offset, logstring, argp);
va_end(argp);
+ char *clientAddressString = Util_clientAddressToString(client);
offset += snprintf(&buf[offset], STRSIZE - offset, " - [%d] %s@%s:%d",
client->sessionId,
client->username == NULL ? "" : client->username,
- Util_clientAddressToString(client),
+ clientAddressString,
Util_clientAddressToPortTCP(client));
+ free(clientAddressString);
if (termprint)
fprintf(stderr, "%s\n", buf);