Re: malloc_error_break
Re: malloc_error_break
- Subject: Re: malloc_error_break
- From: email@hidden
- Date: Thu, 21 Oct 2010 15:06:20 -0600
On Oct 21, 2010, at 2:48 PM, David Duncan wrote:
On Oct 21, 2010, at 1:44 PM, email@hidden wrote:
Not a Cocoa topic but I am thinking the smart guys here can show me
the error of my ways.
I do this:
BYTE *destination = (BYTE*)malloc(size);
... do stuff
free(destination);
The free() gives this error
malloc: *** error for object 0x21568580: Non-aligned pointer being
freed (2)
How can I avoid this?
Did you perhaps change destination between malloc() and free()?
Yes I did as I was memcpy'ing to it. I had saved it in another
variable and I now free that and problem goes away.
Thanks!
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden