www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/28/12:14:15

From: "Marcus" <mesthlm AT hem DOT passagen DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Prevent crash on free()
Date: Mon, 28 Feb 2000 16:47:32 +0100
Organization: Telenordia
Lines: 18
Message-ID: <89e5e3$8g1$1@cubacola.tninet.se>
NNTP-Posting-Host: 193.150.200.251
X-Trace: cubacola.tninet.se 951752963 8705 193.150.200.251 (28 Feb 2000 15:49:23 GMT)
X-Complaints-To: abuse AT algo DOT net
NNTP-Posting-Date: 28 Feb 2000 15:49:23 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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.

--
/regards Marcus

Hi, I'm a signature virus. plz set me as your signature and help me spread
:)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019