From: fmarcos AT jet DOT es (Fernando Marcos) Newsgroups: comp.os.msdos.djgpp Subject: Re: free() ? Date: Thu, 27 Feb 1997 11:10:32 GMT Organization: Unisource Espana NEWS SERVER Lines: 15 Message-ID: <5f3pmh$nn0$1@diana.ibernet.es> References: <330CBD87 DOT 5B1F AT post DOT comstar DOT ru> NNTP-Posting-Host: info57.jet.es To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Dim Zegebart wrote: >void foo(void) >{ int x; > free(&x); >} >What will happens in line free(&x) ? Is it correct ? Probably nothin'!! malloc() places a 'magic number' at the beginning of every memory block it provides. If free() does not find that magic number where it is supposed to be, returns. Or at least I think so after a little study of malloc() sources!