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/asyn-ares.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/asyn-ares.c') diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index c5ec48dbb..724809d4e 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -533,7 +533,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn, bufp = strdup(hostname); if(bufp) { struct ResolverResults *res = NULL; - Curl_safefree(conn->async.hostname); + free(conn->async.hostname); conn->async.hostname = bufp; conn->async.port = port; conn->async.done = FALSE; /* not done */ @@ -541,7 +541,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn, conn->async.dns = NULL; /* clear */ res = calloc(sizeof(struct ResolverResults),1); if(!res) { - Curl_safefree(conn->async.hostname); + free(conn->async.hostname); conn->async.hostname = NULL; return NULL; } -- cgit v1.2.3