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/ldap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/ldap.c') 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; } -- cgit v1.2.3