mirror of
https://github.com/curl/curl.git
synced 2026-08-26 03:03:36 +03:00
tidy-up: replace Curl_safefree with free before re-assignment
Also drop `NULL` assignments after `Curl_safefree()`. Closes #16640
This commit is contained in:
parent
9b523773b8
commit
57218d5327
15 changed files with 45 additions and 49 deletions
|
|
@ -1262,7 +1262,7 @@ sftp_pkey_init(struct Curl_easy *data,
|
|||
if(!sshc->rsa)
|
||||
out_of_memory = TRUE;
|
||||
else if(stat(sshc->rsa, &sbuf)) {
|
||||
Curl_safefree(sshc->rsa);
|
||||
free(sshc->rsa);
|
||||
sshc->rsa = aprintf("%s/.ssh/id_dsa", home);
|
||||
if(!sshc->rsa)
|
||||
out_of_memory = TRUE;
|
||||
|
|
@ -1276,10 +1276,10 @@ sftp_pkey_init(struct Curl_easy *data,
|
|||
/* Nothing found; try the current dir. */
|
||||
sshc->rsa = strdup("id_rsa");
|
||||
if(sshc->rsa && stat(sshc->rsa, &sbuf)) {
|
||||
Curl_safefree(sshc->rsa);
|
||||
free(sshc->rsa);
|
||||
sshc->rsa = strdup("id_dsa");
|
||||
if(sshc->rsa && stat(sshc->rsa, &sbuf)) {
|
||||
Curl_safefree(sshc->rsa);
|
||||
free(sshc->rsa);
|
||||
/* Out of guesses. Set to the empty string to avoid
|
||||
* surprising info messages. */
|
||||
sshc->rsa = strdup("");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue