From: Martin Str|mberg Subject: Re: problem with malloc and free Newsgroups: comp.os.msdos.djgpp References: User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha)) Message-ID: <1039859734.968060@queeg.ludd.luth.se> Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: 14 Dec 2002 09:55:34 GMT Lines: 15 NNTP-Posting-Host: queeg.ludd.luth.se X-Trace: 1039859734 news.luth.se 59766 130.240.16.109 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Lars O. Hansen wrote: : the following code, if compiled per "gcc test.c" and executed (DOS), crashes for some compilations : and then when compiled again crashes not and then again when compiled again, crashes again. : if the (float*) casts are removed, the code always crashes. : if then either atexit(freeall), or either free(cxphi) in main or either free(cm) in freeall or : either free(cxphi) in freeall is removed, the code does not crash. If you free something twice, anything can happen. Right, MartinS