aboutsummaryrefslogtreecommitdiff
path: root/lib/smtp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-03-16 15:01:15 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-03-16 15:01:15 +0100
commit0f4a03cbb6fdb84d05cb6aafe50444edad4f4119 (patch)
tree89472eece4173a97ac3b80aba5e35ed70cdd7845 /lib/smtp.c
parent9e661601feba03d1158ac466a457d5a6ce7f3f11 (diff)
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/smtp.c')
-rw-r--r--lib/smtp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index de2bce328..dada087a9 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -571,7 +571,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
auth = strdup("<>");
if(!auth) {
- Curl_safefree(from);
+ free(from);
return CURLE_OUT_OF_MEMORY;
}
@@ -582,8 +582,8 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
size = aprintf("%" CURL_FORMAT_CURL_OFF_T, data->state.infilesize);
if(!size) {
- Curl_safefree(from);
- Curl_safefree(auth);
+ free(from);
+ free(auth);
return CURLE_OUT_OF_MEMORY;
}
@@ -603,9 +603,9 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
result = Curl_pp_sendf(&conn->proto.smtpc.pp,
"MAIL FROM:%s SIZE=%s", from, size);
- Curl_safefree(from);
- Curl_safefree(auth);
- Curl_safefree(size);
+ free(from);
+ free(auth);
+ free(size);
if(!result)
state(conn, SMTP_MAIL);
@@ -1657,13 +1657,13 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread)
data->state.scratch = scratch;
/* Free the old scratch buffer */
- Curl_safefree(oldscratch);
+ free(oldscratch);
/* Set the new amount too */
data->req.upload_present = si;
}
else
- Curl_safefree(newscratch);
+ free(newscratch);
return CURLE_OK;
}