Loading tests/libtest/first.c +7 −1 Original line number Original line Diff line number Diff line Loading @@ -19,8 +19,14 @@ int main(int argc, char **argv) /* this sends all memory debug messages to a logfile named memdump */ /* this sends all memory debug messages to a logfile named memdump */ char *env = curl_getenv("CURL_MEMDEBUG"); char *env = curl_getenv("CURL_MEMDEBUG"); if(env) { if(env) { /* use the value as file name */ char *s = strdup(env); curl_free(env); curl_free(env); curl_memdebug("memdump"); curl_memdebug(s); free(s); /* this weird strdup() and stuff here is to make the curl_free() get called before the memdebug() as otherwise the memdebug tracing will with tracing a free() without an alloc! */ } } /* this enables the fail-on-alloc-number-N functionality */ /* this enables the fail-on-alloc-number-N functionality */ env = curl_getenv("CURL_MEMLIMIT"); env = curl_getenv("CURL_MEMLIMIT"); Loading Loading
tests/libtest/first.c +7 −1 Original line number Original line Diff line number Diff line Loading @@ -19,8 +19,14 @@ int main(int argc, char **argv) /* this sends all memory debug messages to a logfile named memdump */ /* this sends all memory debug messages to a logfile named memdump */ char *env = curl_getenv("CURL_MEMDEBUG"); char *env = curl_getenv("CURL_MEMDEBUG"); if(env) { if(env) { /* use the value as file name */ char *s = strdup(env); curl_free(env); curl_free(env); curl_memdebug("memdump"); curl_memdebug(s); free(s); /* this weird strdup() and stuff here is to make the curl_free() get called before the memdebug() as otherwise the memdebug tracing will with tracing a free() without an alloc! */ } } /* this enables the fail-on-alloc-number-N functionality */ /* this enables the fail-on-alloc-number-N functionality */ env = curl_getenv("CURL_MEMLIMIT"); env = curl_getenv("CURL_MEMLIMIT"); Loading