diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-03-16 15:01:15 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-03-16 15:01:15 +0100 |
commit | 0f4a03cbb6fdb84d05cb6aafe50444edad4f4119 (patch) | |
tree | 89472eece4173a97ac3b80aba5e35ed70cdd7845 /lib/ssh.c | |
parent | 9e661601feba03d1158ac466a457d5a6ce7f3f11 (diff) | |
download | curl-0f4a03cbb6fdb84d05cb6aafe50444edad4f4119.tar.gz |
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.
Diffstat (limited to 'lib/ssh.c')
-rw-r--r-- | lib/ssh.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -855,7 +855,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) } if(out_of_memory || sshc->rsa == NULL) { - Curl_safefree(home); + free(home); Curl_safefree(sshc->rsa); Curl_safefree(sshc->rsa_pub); state(conn, SSH_SESSION_FREE); @@ -867,7 +867,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) if(!sshc->passphrase) sshc->passphrase = ""; - Curl_safefree(home); + free(home); infof(data, "Using SSH public key file '%s'\n", sshc->rsa_pub); infof(data, "Using SSH private key file '%s'\n", sshc->rsa); @@ -1918,7 +1918,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) } result = Curl_client_write(conn, CLIENTWRITE_BODY, tmpLine, sshc->readdir_len+1); - Curl_safefree(tmpLine); + free(tmpLine); if(result) { state(conn, SSH_STOP); @@ -3267,8 +3267,8 @@ get_pathname(const char **cpp, char **path) return CURLE_OK; fail: - Curl_safefree(*path); - return CURLE_QUOTE_ERROR; + Curl_safefree(*path); + return CURLE_QUOTE_ERROR; } |