From 0f4a03cbb6fdb84d05cb6aafe50444edad4f4119 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 16 Mar 2015 15:01:15 +0100 Subject: 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. --- lib/smtp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/smtp.c') 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; } -- cgit v1.2.3