the malloc debug system only logs data if the logfile FILE * is set, which
makes it easier to disable debug output when built with debug functions
This commit is contained in:
22
lib/hostip.c
22
lib/hostip.c
@@ -96,21 +96,27 @@ int curl_getaddrinfo(char *hostname, char *service,
|
||||
int line, const char *source)
|
||||
{
|
||||
int res=(getaddrinfo)(hostname, service, hints, result);
|
||||
if(0 == res)
|
||||
if(0 == res) {
|
||||
/* success */
|
||||
fprintf(logfile?logfile:stderr, "ADDR %s:%d getaddrinfo() = %p\n",
|
||||
source, line, *result);
|
||||
else
|
||||
fprintf(logfile?logfile:stderr, "ADDR %s:%d getaddrinfo() failed\n",
|
||||
source, line);
|
||||
if(logfile)
|
||||
fprintf(logfile, "ADDR %s:%d getaddrinfo() = %p\n",
|
||||
source, line, *result);
|
||||
}
|
||||
else {
|
||||
if(logfile)
|
||||
fprintf(logfile, "ADDR %s:%d getaddrinfo() failed\n",
|
||||
source, line);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void curl_freeaddrinfo(struct addrinfo *freethis,
|
||||
int line, const char *source)
|
||||
{
|
||||
(freeaddrinfo)(freethis);
|
||||
fprintf(logfile?logfile:stderr, "ADDR %s:%d freeaddrinfo(%p)\n",
|
||||
source, line, freethis);
|
||||
if(logfile)
|
||||
fprintf(logfile, "ADDR %s:%d freeaddrinfo(%p)\n",
|
||||
source, line, freethis);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user