MJ wrote: > Dear all, > > I am a new C programer and I would like to have some information about fixing > the memory leaks. > Any program or article that you have found them useful can help mo improve my > knowledge. > > Thanks, > MJ
Finding leaks is the first step. There are a number of ways to do this. Some involve specialized code profiling tools. Alternatively, you could write your own allocator (if C++) or use macros and some custom functions (C). Some compilers have built in (albeit very basic) support for tracking leaks. Fixing memory leaks is easy: Match every malloc()/realloc() to a free() and every new/new [] to a delete/delete []. But don't double free()/delete. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* VerifyMyPC 2.0 Change tracking and management tool. Reduce tech. support times from 2 hours to 5 minutes. Free for personal use, $10 otherwise. http://www.CubicleSoft.com/VerifyMyPC/
