Fix curl free() ambiguity - fixes windows issues

curl_free() is to be used for data allocated by
curl_easy_escape() or curl_easy_unescape() in libcurl.

This is unrelated to realloc/free in WriteMemoryCallback().
This commit is contained in:
Robin Gareus 2021-02-28 15:17:30 +01:00
parent f8ba27f417
commit b553b67407
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 4 additions and 2 deletions

View File

@ -180,7 +180,7 @@ HttpGet::~HttpGet ()
curl_easy_cleanup (_curl);
}
if (!persist) {
free (mem.data);
::free (mem.data);
}
}
@ -212,7 +212,7 @@ HttpGet::get (const char* url, bool with_error_logging)
}
if (!persist) {
free (mem.data);
::free (mem.data);
} // otherwise caller is expected to have free()d or re-used it.
error_buffer[0] = 0;

View File

@ -62,6 +62,8 @@ class HttpGet {
return curl_easy_unescape (_curl, s, l, o);
}
/* this is only to be used for data returned by from
* \ref escape() and \ref unescape() */
void free (void *p) const {
curl_free (p);
}