Skip to content

Commit

Permalink
Fix memory leak in scripthttprequesthandler.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
xCynDev committed Nov 30, 2024
1 parent 21843ee commit b4e14fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions primedev/scripts/scripthttprequesthandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b4e14fc

Please sign in to comment.