You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Daniel Stenberg 67a83c1b34 David Shaw finally removed all traces of Gopher and we are now officially 17 years ago
..
.cvsignore ignore curllib.dsp 19 years ago
Makefile.Watcom Changes for OpenWatcom 1.4. 18 years ago
Makefile.am Updated the copyright year since changes have been this year. 18 years ago
Makefile.b32 Static lib is libcurl.lib and import lib libcurl_imp.lib. 19 years ago
Makefile.inc Moved the sockaddr_storage definition to lib/sockaddr.h and only include that 18 years ago
Makefile.m32 OpenSSL updates; get CA_BUNDLE from env. Assume no 19 years ago
Makefile.netware minor Makefile fixes. 18 years ago
Makefile.riscos GnuTLS updates 18 years ago
Makefile.vc6 Kirill Vasiliev fixed the 'release-ssl-dll' target to properly build a 18 years ago
README.ares up-to-date with reality 19 years ago
README.curlx updated with more and new info 19 years ago
README.encoding Fixed a lingering omission of gzip support. 18 years ago
README.hostip Added README.hostip 18 years ago
README.httpauth HTTP "auth done right". See lib/README.httpauth 19 years ago
README.memoryleak CURLDEBUG, not MALLOCDEBUG 20 years ago
amigaos.c Made the copyright year match the latest modification's year. 17 years ago
amigaos.h Made the copyright year match the latest modification's year. 17 years ago
arpa_telnet.h Make some more arrays of pointers const. 19 years ago
base64.c Updated the copyright year since changes have been this year. 18 years ago
base64.h Updated the copyright year since changes have been this year. 18 years ago
ca-bundle.crt Removed the "TC TrustCenter, Germany, Class 0 CA." certificate: 20 years ago
config-amigaos.h Diego Casorran patches to make (lib)curl build fine on Amiga again 18 years ago
config-mac.h Fixed LDAP library file name bug (KNOWN_BUGS #1). configure now auto-detects 18 years ago
config-riscos.h Fixed LDAP library file name bug (KNOWN_BUGS #1). configure now auto-detects 18 years ago
config-win32.h Changes for PellesC compiler under Win32. A bit limited, but 18 years ago
config-win32ce.h Fix spacing. When defining, define to 1. 18 years ago
config.dj 'ssize_t' seems to be a gcc 4.x built-in. 18 years ago
connect.c Cleanup windows header includes. Where aplicable, inclusion of 18 years ago
connect.h conn->ip_addr MUST NOT be used on re-used connections 18 years ago
content_encoding.c Updated the copyright year since changes have been this year. 18 years ago
content_encoding.h strip trailing whitespace 19 years ago
cookie.c remove the typecast to long from time_t, since we now store it as curl_off_t 18 years ago
cookie.h Made the copyright year match the latest modification's year. 17 years ago
curllib.dsw Hanno L. Kranzhoff fixed them 21 years ago
curlx.h delete trailing whitespace 19 years ago
dict.c FTP code turned into state machine. Not completely yet, but a good start. 18 years ago
dict.h FTP code turned into state machine. Not completely yet, but a good start. 18 years ago
easy.c Bryan Henderson turned the 'initialized' variable for curl_global_init() 17 years ago
easyif.h Updated the copyright year since changes have been this year. 18 years ago
escape.c Variable type cleanups to please the picky MIPSPro compiler. 19 years ago
escape.h Made the copyright year match the latest modification's year. 17 years ago
file.c fix questionable compare compiler error (unsigned can't be < 0) 17 years ago
file.h FTP code turned into state machine. Not completely yet, but a good start. 18 years ago
formdata.c Yang Tse: fix compilation errors when SSL is not disabled and HTTP is 18 years ago
formdata.h Allow formposting of files larger than what fits in memory by not reading the 19 years ago
ftp.c Fixed FTP_SKIP_PASV_IP and FTP_USE_EPSV to "do right" when used on FTP thru 17 years ago
ftp.h FTP code turned into state machine. Not completely yet, but a good start. 18 years ago
getenv.c Made the copyright year match the latest modification's year. 17 years ago
getinfo.c Peteris Krumins added CURLOPT_COOKIELIST and CURLINFO_COOKIELIST, which is a 18 years ago
getinfo.h updated year in the copyright string 19 years ago
gtls.c to build with old gnutls verions, don't use the *_t types 18 years ago
gtls.h GnuTLS support added. There's now a "generic" SSL layer that we use all over 18 years ago
hash.c Use plain structs and not typedef'ed ones in the hash and linked-list code. 18 years ago
hash.h Use plain structs and not typedef'ed ones in the hash and linked-list code. 18 years ago
hostares.c only define _REENTRANT if not already defined, and only in setup.h 18 years ago
hostasyn.c only define _REENTRANT if not already defined, and only in setup.h 18 years ago
hostip.c only define _REENTRANT if not already defined, and only in setup.h 18 years ago
hostip.h Undo last changes 18 years ago
hostip4.c keep 'socktype' in the connectdata struct and make sure we use that for all 18 years ago
hostip6.c Undo last 'fix', since it was not the proper one. 18 years ago
hostsyn.c only define _REENTRANT if not already defined, and only in setup.h 18 years ago
hostthre.c Yang Tse: use static on file-private functions 18 years ago
http.c Made the copyright year match the latest modification's year. 17 years ago
http.h Andrew Bushnell provided enough info for me to tell that we badly needed to 18 years ago
http_chunks.c Adrian Schuur added trailer support in the chunked encoding stream. The 18 years ago
http_chunks.h Adrian Schuur added trailer support in the chunked encoding stream. The 18 years ago
http_digest.c Dan Fandrich added the --disable-crypto-auth option to configure to allow 19 years ago
http_digest.h return CURLDIGEST_NOMEM when a memory function fails to deliver 19 years ago
http_negotiate.c Updated the copyright year since changes have been this year. 18 years ago
http_negotiate.h updated year in the copyright string 19 years ago
http_ntlm.c Quagmire reported that he needed to raise a NTLM buffer for SSPI to work 18 years ago
http_ntlm.h only enable NTLM if HTTP and NTLM is not disabled, and if NTLM is disabled 18 years ago
if2ip.c Diego Casorran patches to make (lib)curl build fine on Amiga again 18 years ago
if2ip.h Updated the copyright year since changes have been this year. 18 years ago
inet_ntoa_r.h provide the proper copyright texts for these 18 years ago
inet_ntop.c Replaced nonstandard u_char and u_int types 18 years ago
inet_ntop.h Yang Tse: fixes the use of Curl_inet_ntop and Curl_inet_pton with no 18 years ago
inet_pton.c Replaced nonstandard u_char and u_int types 18 years ago
inet_pton.h Yang Tse's changes to provide an inet_pton() proto for the platforms who 18 years ago
krb4.c Removed security.h since it shadows an include file mingw needs when building 18 years ago
krb4.h GnuTLS support added. There's now a "generic" SSL layer that we use all over 18 years ago
ldap.c Cleanup windows header includes. Where aplicable, inclusion of 18 years ago
ldap.h FTP code turned into state machine. Not completely yet, but a good start. 18 years ago
libcurl.def Yang Tse: msvc7+ has deprecated the 'DESCRIPTION' section in 18 years ago
libcurl.framework.make added new files 18 years ago
libcurl.imp added curl_mvsnprintf to the export list. 18 years ago
libcurl.plist Matt Veenstra updated to 7.12.3. Starting now, we'll update the version number 19 years ago
libcurl.rc Update copyright. 18 years ago
llist.c Use plain structs and not typedef'ed ones in the hash and linked-list code. 18 years ago
llist.h Use plain structs and not typedef'ed ones in the hash and linked-list code. 18 years ago
makefile.amiga Diego Casorran patches to make (lib)curl build fine on Amiga again 18 years ago
makefile.dj Updated generated dependencies. 18 years ago
md5.c corrected copyright year 18 years ago
md5.h Add 'const' to immutable arrays. 19 years ago
memdebug.c use %p to printf pointers since %x doesn't work properly on tru64 for this 18 years ago
memdebug.h Yang Tse fixed compiler warnings 18 years ago
memory.h removed tabs and trailing whitespace from source 19 years ago
mprintf.c Diego Casorran patches to make (lib)curl build fine on Amiga again 18 years ago
msvcproj.foot new attempt at an improved DSP-file generation 19 years ago
msvcproj.head Use the more correct BUILDING_LIBCURL define instead of CURLLIB_EXPORTS. 18 years ago
multi.c remove old printf() debug leftover 18 years ago
multiif.h Updated the copyright year since changes have been this year. 18 years ago
netrc.c corrected copyright year 18 years ago
netrc.h updated year in the copyright string 19 years ago
nwlib.c converted to UNIX format. 19 years ago
parsedate.c fix questionable compare 17 years ago
parsedate.h Updated the copyright year since changes have been this year. 18 years ago
progress.c As reported in Mandrake's bug tracker bug 12289 19 years ago
progress.h clean up start time and t_startsingle use so that redirect_time works properly 19 years ago
security.c Removed security.h since it shadows an include file mingw needs when building 18 years ago
select.c Thanks to this nice summary of poll() implementations: 18 years ago
select.h Suppress signed vs. unsigned warnings on Win32 19 years ago
sendf.c GnuTLS support added. There's now a "generic" SSL layer that we use all over 18 years ago
sendf.h FTP code turned into state machine. Not completely yet, but a good start. 18 years ago
setup.h David Shaw finally removed all traces of Gopher and we are now officially 17 years ago
share.c Dan Fandrich added the --disable-cookies option to configure to build 19 years ago
share.h Use plain structs and not typedef'ed ones in the hash and linked-list code. 18 years ago
sockaddr.h oops * 2 18 years ago
speedcheck.c removed tabs and trailing whitespace from source 19 years ago
speedcheck.h updated year in the copyright string 19 years ago
sslgen.c removed old debug left-over infof() call 18 years ago
sslgen.h GnuTLS support added. There's now a "generic" SSL layer that we use all over 18 years ago
ssluse.c Fixed lcc compiler warnings. 18 years ago
ssluse.h GnuTLS support added. There's now a "generic" SSL layer that we use all over 18 years ago
strequal.c removed tabs and trailing whitespace from source 19 years ago
strequal.h modified this year 18 years ago
strerror.c Yang Tse's fix to only provide the proto if there is such a function and 18 years ago
strerror.h removed trailing whitespace 19 years ago
strtok.c Dan Fandrich's cleanup patch to make pedantic compiler options cause less 19 years ago
strtok.h updated year in the copyright string 19 years ago
strtoofft.c Made the copyright year match the latest modification's year. 17 years ago
strtoofft.h Watcom uses 'i64' suffix. 19 years ago
telnet.c nonsense change for(;;) => while(1) just to prevent gcc from warning on 18 years ago
telnet.h FTP code turned into state machine. Not completely yet, but a good start. 18 years ago
tftp.c Fix compiler warning 18 years ago
tftp.h John Kelly added TFTP support to libcurl. A bunch of new error codes was 18 years ago
timeval.c Made the copyright year match the latest modification's year. 17 years ago
timeval.h Made the copyright year match the latest modification's year. 17 years ago
transfer.c Doug Kaufman's set of patches to make curl build fine on DJGPP again using 18 years ago
transfer.h Updated the copyright year since changes have been this year. 18 years ago
url.c David Shaw finally removed all traces of Gopher and we are now officially 17 years ago
url.h Simplified the code within curl_easy_perform() that calls Curl_perform(). 18 years ago
urldata.h David Shaw finally removed all traces of Gopher and we are now officially 17 years ago
version.c David Shaw finally removed all traces of Gopher and we are now officially 17 years ago

README.memoryleak

$Id$
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|

How To Track Down Suspected Memory Leaks in libcurl
===================================================

Single-threaded

Please note that this memory leak system is not adjusted to work in more
than one thread. If you want/need to use it in a multi-threaded app. Please
adjust accordingly.


Build

Rebuild libcurl with -DCURLDEBUG (usually, rerunning configure with
--enable-debug fixes this). 'make clean' first, then 'make' so that all
files actually are rebuilt properly. It will also make sense to build
libcurl with the debug option (usually -g to the compiler) so that debugging
it will be easier if you actually do find a leak in the library.

This will create a library that has memory debugging enabled.

Modify Your Application

Add a line in your application code:

curl_memdebug("filename");

This will make the malloc debug system output a full trace of all resource
using functions to the given file name. Make sure you rebuild your program
and that you link with the same libcurl you built for this purpose as
described above.

Run Your Application

Run your program as usual. Watch the specified memory trace file grow.

Make your program exit and use the proper libcurl cleanup functions etc. So
that all non-leaks are returned/freed properly.

Analyze the Flow

Use the tests/memanalyze.pl perl script to analyze the memdump file:

tests/memanalyze.pl < memdump

This now outputs a report on what resources that were allocated but never
freed etc. This report is very fine for posting to the list!

If this doesn't produce any output, no leak was detected in libcurl. Then
the leak is mostly likely to be in your code.