From 4823a2be7073230c6a78fd4020cfa31d24d5298a Mon Sep 17 00:00:00 2001 From: universal963 <36097923+universal963@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:40:21 +0800 Subject: [PATCH 1/2] Fix possible memory leak --- dll/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/network.cpp b/dll/network.cpp index 47cb5f587..b329fb7fb 100644 --- a/dll/network.cpp +++ b/dll/network.cpp @@ -110,7 +110,7 @@ static void get_broadcast_info(uint16 port) number_broadcasts++; if (number_broadcasts >= MAX_BROADCASTS) { - return; + break; } } From ff5ef4f721be2e043833189f23559b25724c2e7b Mon Sep 17 00:00:00 2001 From: universal963 <36097923+universal963@users.noreply.github.com> Date: Tue, 15 Oct 2024 23:45:32 +0800 Subject: [PATCH 2/2] One more fix --- dll/network.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dll/network.cpp b/dll/network.cpp index b329fb7fb..60b6b4cd9 100644 --- a/dll/network.cpp +++ b/dll/network.cpp @@ -542,6 +542,8 @@ std::set Networking::resolve_ip(std::string dns) } } + if (result) + freeaddrinfo(result); return ips; }