mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-17 07:41:39 +00:00
Common/HttpRequest: Fix EscapeComponent leaking memory
This commit is contained in:
parent
23986d48f7
commit
ca5eac0c63
1 changed files with 5 additions and 1 deletions
|
@ -167,7 +167,11 @@ void HttpRequest::Impl::FollowRedirects(long max)
|
||||||
|
|
||||||
std::string HttpRequest::Impl::EscapeComponent(const std::string& string)
|
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)
|
static size_t CurlWriteCallback(char* data, size_t size, size_t nmemb, void* userdata)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue