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/gopher.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/gopher.c')
-rw-r--r-- | lib/gopher.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gopher.c b/lib/gopher.c index 18d100f43..954cad8e0 100644 --- a/lib/gopher.c +++ b/lib/gopher.c @@ -120,7 +120,7 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done) if(!result) { /* Which may not have written it all! */ result = Curl_client_write(conn, CLIENTWRITE_HEADER, sel, amount); if(result) { - Curl_safefree(sel_org); + free(sel_org); return result; } k -= amount; @@ -130,7 +130,7 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done) } else { failf(data, "Failed sending Gopher request"); - Curl_safefree(sel_org); + free(sel_org); return result; } /* Don't busyloop. The entire loop thing is a work-around as it causes a @@ -145,7 +145,7 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done) Curl_socket_ready(CURL_SOCKET_BAD, sockfd, 100); } - Curl_safefree(sel_org); + free(sel_org); /* We can use Curl_sendf to send the terminal \r\n relatively safely and save allocing another string/doing another _write loop. */ |