From: "Campbell, Rolf [SKY:1U32:EXCH]" Newsgroups: comp.os.msdos.djgpp Subject: Re: Prevent crash on free() Date: Mon, 28 Feb 2000 14:34:13 -0500 Organization: Nortel Networks Lines: 20 Message-ID: <38BACDB5.6211DF3F@americasm01.nt.com> References: <89e5e3$8g1$1 AT cubacola DOT tninet DOT se> NNTP-Posting-Host: wmerh0tk.ca.nortel.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.72 [en] (X11; I; HP-UX B.10.20 9000/785) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Marcus wrote: > Hi! > How can I test if a memory is permanently alloced with malloc? To prevent > crash on free(). > Like: > void safefree (void* mem) > { > if(memory_is_malloc(mem)) > free(mem); > } > Because the program crash if I use free careless. So don't use free carelessly. -- (\/) Rolf Campbell (\/)