Date: Thu, 9 Dec 1999 16:03:17 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Wormy cc: djgpp AT delorie DOT com Subject: Re: Problems with MALLOC and FREE In-Reply-To: <82o2l4$hmr@cantine.wu-wien.ac.at> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 9 Dec 1999, Wormy wrote: > But if, at shutdown, I do > > for (x=0; x<4096; x++) > if (mem[x] != NULL) > free (mem[x]); > > IT HAPPENS... WELL, MORE THAN ONLY SOMETIMES THAT I GET A SIGSEGV!!!!! > WHY IS THAT??? This usually means that your program either overwrites the buffers that you allocate (like if it puts more than 64 bytes into each 64-byte buffer), or that it free()'s some of the buffers more than once.