From b4e14fcefdc6777ee52fcdd3bc19a2881f16dd49 Mon Sep 17 00:00:00 2001 From: xCynDev <181435937+xCynDev@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:14:38 -0800 Subject: [PATCH] Fix memory leak in scripthttprequesthandler.cpp --- primedev/scripts/scripthttprequesthandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/primedev/scripts/scripthttprequesthandler.cpp b/primedev/scripts/scripthttprequesthandler.cpp index f45e83f0d..e3249a3f5 100644 --- a/primedev/scripts/scripthttprequesthandler.cpp +++ b/primedev/scripts/scripthttprequesthandler.cpp @@ -143,6 +143,7 @@ bool IsHttpDestinationHostAllowed(const std::string& host, std::string& outHostn spdlog::error("Failed to resolve http request destination {} into a valid IPv4 address.", urlHostname); } + freeaddrinfo(result); curl_free(urlHostname); curl_free(urlScheme); curl_free(urlPort); @@ -174,6 +175,7 @@ bool IsHttpDestinationHostAllowed(const std::string& host, std::string& outHostn || addrBytes.s_b1 == 233 && addrBytes.s_b2 == 252 && addrBytes.s_b3 == 0 // 233.252.0.0 - 233.252.0.255 (MCAST-TEST-NET) || addrBytes.s_b1 >= 240 && addrBytes.s_b4 <= 254) // 240.0.0.0 - 255.255.255.254 (Future Use Class E) { + freeaddrinfo(result); curl_free(urlHostname); curl_free(urlScheme); curl_free(urlPort);