From: Gisle Vanem Date: Sat, 22 Jul 2006 14:51:39 +0000 (+0000) Subject: If CURLDEBUG defined, call curl_memdebug() if $CARES_MEMDEBUG is set. X-Git-Tag: curl-7_15_5~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=655ec6bf8e440725bd1cc931d4ef4ab66601704d;p=thirdparty%2Fcurl.git If CURLDEBUG defined, call curl_memdebug() if $CARES_MEMDEBUG is set. --- diff --git a/ares/ares_init.c b/ares/ares_init.c index 2f320a2fa0..b26a4340de 100644 --- a/ares/ares_init.c +++ b/ares/ares_init.c @@ -93,6 +93,16 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options, struct server_state *server; struct timeval tv; +#ifdef CURLDEBUG + const char *env = getenv("CARES_MEMDEBUG"); + + if (env) + curl_memdebug(env); + env = getenv("CARES_MEMLIMIT"); + if (env) + curl_memlimit(atoi(env)); +#endif + channel = malloc(sizeof(struct ares_channeldata)); if (!channel) return ARES_ENOMEM;