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:
parent
f8ba27f417
commit
b553b67407
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue