don't we need to release memory before exit(1)?

This is a discussion on don't we need to release memory before exit(1)? within the C Programming forums, part of the General Programming Boards category; Dear there, I learned to release everything malloced before exit. however this code from die.net doesn't do it. tsearch(3): manage ...

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    48

    don't we need to release memory before exit(1)?

    Dear there,

    I learned to release everything malloced before exit. however this code from die.net doesn't do it.
    tsearch(3): manage binary tree - Linux man page

    is it wrong or I missed something?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,986
    Since the OS in question will reclaim the memory anyway, it is not necessary. On the other hand, getting into the habit of not releasing memory when you are done with it can be a Bad Thing.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory Fragmentation with Dynamic FIFO Queue
    By fguy817817 in forum Linux Programming
    Replies: 17
    Last Post: 10-31-2009, 04:17 AM
  2. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  3. Memory usage and memory leaks
    By vsanandan in forum C Programming
    Replies: 1
    Last Post: 05-03-2008, 05:45 AM
  4. What's the difference?
    By Stonehambey in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 10:26 AM
  5. Error when freeing memory
    By foniks munkee in forum C Programming
    Replies: 9
    Last Post: 03-01-2002, 07:28 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21