mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:43:34 +03:00
free: instead of Curl_safefree()
Since we just started make use of free(NULL) in order to simplify code, this change takes it a step further and: - converts lots of Curl_safefree() calls to good old free() - makes Curl_safefree() not check the pointer before free() The (new) rule of thumb is: if you really want a function call that frees a pointer and then assigns it to NULL, then use Curl_safefree(). But we will prefer just using free() from now on.
This commit is contained in:
parent
9e661601fe
commit
0f4a03cbb6
35 changed files with 202 additions and 202 deletions
|
|
@ -301,7 +301,7 @@ static CURLcode http_output_basic(struct connectdata *conn, bool proxy)
|
|||
if(!authorization)
|
||||
return CURLE_REMOTE_ACCESS_DENIED;
|
||||
|
||||
Curl_safefree(*userp);
|
||||
free(*userp);
|
||||
*userp = aprintf("%sAuthorization: Basic %s\r\n",
|
||||
proxy?"Proxy-":"",
|
||||
authorization);
|
||||
|
|
@ -3483,7 +3483,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
|||
if(Curl_pipeline_server_blacklisted(data, server_name))
|
||||
conn->bundle->server_supports_pipelining = FALSE;
|
||||
}
|
||||
Curl_safefree(server_name);
|
||||
free(server_name);
|
||||
}
|
||||
else if((conn->httpversion == 10) &&
|
||||
conn->bits.httpproxy &&
|
||||
|
|
@ -3688,7 +3688,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
|||
|
||||
result = Curl_http_input_auth(conn, proxy, auth);
|
||||
|
||||
Curl_safefree(auth);
|
||||
free(auth);
|
||||
|
||||
if(result)
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue