* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
#include "inet_ntop.h"
#include "curl_threads.h"
#include "connect.h"
-#include "curl_printf.h"
-#include "curl_memory.h"
+#define _MPRINTF_REPLACE /* use our functions only */
+#include <curl/mprintf.h>
+
+#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
free(tsd->mtx);
}
- free(tsd->hostname);
+ if(tsd->hostname)
+ free(tsd->hostname);
if(tsd->res)
Curl_freeaddrinfo(tsd->res);
- memset(tsd, 0, sizeof(*tsd));
+ memset(tsd,0,sizeof(*tsd));
}
/* Initialize resolver thread synchronization data */
}
async->os_specific = NULL;
- free(async->hostname);
+ if(async->hostname)
+ free(async->hostname);
+
async->hostname = NULL;
}
if(!init_thread_sync_data(td, hostname, port, hints))
goto err_exit;
- free(conn->async.hostname);
+ Curl_safefree(conn->async.hostname);
conn->async.hostname = strdup(hostname);
if(!conn->async.hostname)
goto err_exit;