summaryrefslogtreecommitdiff
path: root/lib/ldap.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/ldap.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/ldap.c')
-rw-r--r--lib/ldap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ldap.c b/lib/ldap.c
index 8434f7896..6ad66ff4d 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -852,7 +852,7 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
ludp->lud_attrs = calloc(count + 1, sizeof(char *));
#endif
if(!ludp->lud_attrs) {
- Curl_safefree(attributes);
+ free(attributes);
rc = LDAP_NO_MEMORY;
@@ -867,7 +867,7 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
/* Unescape the attribute */
unescaped = curl_easy_unescape(conn->data, attributes[i], 0, NULL);
if(!unescaped) {
- Curl_safefree(attributes);
+ free(attributes);
rc = LDAP_NO_MEMORY;
@@ -882,7 +882,7 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
Curl_unicodefree(unescaped);
if(!ludp->lud_attrs[i]) {
- Curl_safefree(attributes);
+ free(attributes);
rc = LDAP_NO_MEMORY;
@@ -895,7 +895,7 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
ludp->lud_attrs_dups++;
}
- Curl_safefree(attributes);
+ free(attributes);
}
p = q;
@@ -965,7 +965,7 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
}
quit:
- Curl_safefree(path);
+ free(path);
return rc;
}