summaryrefslogtreecommitdiff
path: root/lib/imap.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/imap.c
parent9e661601feba03d1158ac466a457d5a6ce7f3f11 (diff)
downloadcurl-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/imap.c')
-rw-r--r--lib/imap.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 6db221bc1..e6d83f2cf 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -547,8 +547,8 @@ static CURLcode imap_perform_login(struct connectdata *conn)
result = imap_sendf(conn, "LOGIN %s %s", user ? user : "",
passwd ? passwd : "");
- Curl_safefree(user);
- Curl_safefree(passwd);
+ free(user);
+ free(passwd);
if(!result)
state(conn, IMAP_LOGIN);
@@ -661,7 +661,7 @@ static CURLcode imap_perform_list(struct connectdata *conn)
/* Send the LIST command */
result = imap_sendf(conn, "LIST \"%s\" *", mailbox);
- Curl_safefree(mailbox);
+ free(mailbox);
}
if(!result)
@@ -702,7 +702,7 @@ static CURLcode imap_perform_select(struct connectdata *conn)
/* Send the SELECT command */
result = imap_sendf(conn, "SELECT %s", mailbox);
- Curl_safefree(mailbox);
+ free(mailbox);
if(!result)
state(conn, IMAP_SELECT);
@@ -777,7 +777,7 @@ static CURLcode imap_perform_append(struct connectdata *conn)
result = imap_sendf(conn, "APPEND %s (\\Seen) {%" CURL_FORMAT_CURL_OFF_T "}",
mailbox, conn->data->state.infilesize);
- Curl_safefree(mailbox);
+ free(mailbox);
if(!result)
state(conn, IMAP_APPEND);
@@ -1800,7 +1800,7 @@ static CURLcode imap_sendf(struct connectdata *conn, const char *fmt, ...)
result = Curl_pp_vsendf(&imapc->pp, taggedfmt, ap);
va_end(ap);
- Curl_safefree(taggedfmt);
+ free(taggedfmt);
return result;
}
@@ -2031,7 +2031,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
/* Decode the value parameter */
result = Curl_urldecode(data, begin, ptr - begin, &value, &valuelen, TRUE);
if(result) {
- Curl_safefree(name);
+ free(name);
return result;
}
@@ -2070,14 +2070,14 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
value = NULL;
}
else {
- Curl_safefree(name);
- Curl_safefree(value);
+ free(name);
+ free(value);
return CURLE_URL_MALFORMAT;
}
- Curl_safefree(name);
- Curl_safefree(value);
+ free(name);
+ free(value);
}
/* Does the URL contain a query parameter? Only valid when we have a mailbox