From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <7e4ee9ce78f7ac577e340450c5435773@coraid.com> From: erik quanstrom Date: Fri, 5 Jan 2007 09:54:44 -0500 To: sretzki@gmx.de, 9fans@cse.psu.edu Subject: Re: [9fans] memory woes MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: Topicbox-Message-UUID: fdfbc53e-ead1-11e9-9d60-3106f5b1d025 libpool writes a magic byte at the end of the allocation. if this is not present when memory is free'd, libpool assumes you've corrupted memory and aborts. - erik On Fri Jan 5 09:52:13 EST 2007, sretzki@gmx.de wrote: > > you are forgetting +1 for the null. you need strlen("Hello World")+1. > > Heh! Yeah, true. But then the strcpy() would write into non-allocated area, so why does the free()-call make it crash?