Skip to content
Permalink
Browse files

Common/HttpRequest: Fix EscapeComponent leaking memory

  • Loading branch information...
spycrab committed Apr 6, 2019
1 parent 23986d4 commit ca5eac0c63b10a961d8350040a0eb683a4ce52b6
Showing with 5 additions and 1 deletion.
  1. +5 −1 Source/Core/Common/HttpRequest.cpp
@@ -167,7 +167,11 @@ void HttpRequest::Impl::FollowRedirects(long max)

std::string HttpRequest::Impl::EscapeComponent(const std::string& string)
{
return curl_easy_escape(m_curl.get(), string.c_str(), static_cast<int>(string.size()));
char* escaped = curl_easy_escape(m_curl.get(), string.c_str(), static_cast<int>(string.size()));
std::string escaped_str(escaped);
curl_free(escaped);

return escaped_str;
}

static size_t CurlWriteCallback(char* data, size_t size, size_t nmemb, void* userdata)

0 comments on commit ca5eac0

Please sign in to comment.
You can’t perform that action at this time.