Skip to content
Snippets Groups Projects
Commit 3c911b91 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix UDP buffer memory leak when max clients reached

Caught by Coverity-scan CID 330055
parent f3e4a6e4
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -2247,6 +2247,7 @@ void DLLCALL services_thread(void* arg) ...@@ -2247,6 +2247,7 @@ void DLLCALL services_thread(void* arg)
,service[i].protocol, host_ip, inet_addrport(&client_addr)); ,service[i].protocol, host_ip, inet_addrport(&client_addr));
if(service[i].max_clients && protected_uint32_value(service[i].clients) + 1 > service[i].max_clients) { if(service[i].max_clients && protected_uint32_value(service[i].clients) + 1 > service[i].max_clients) {
FREE_AND_NULL(udp_buf);
lprintf(LOG_WARNING,"%04d %s !MAXIMUM CLIENTS (%u) reached, access denied" lprintf(LOG_WARNING,"%04d %s !MAXIMUM CLIENTS (%u) reached, access denied"
,client_socket, service[i].protocol, service[i].max_clients); ,client_socket, service[i].protocol, service[i].max_clients);
close_socket(client_socket); close_socket(client_socket);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment