Thread
:
crash in malloc() ?
View Single Post
Re: crash in malloc() ?
(#
8
)
botman
Super Moderator
Status:
Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Re: crash in malloc() ? -
08-04-2004
malloc() crashes are usually due to you allocating and then freeing memory, and then having your program write to that memory location. Like this...
Code:
char *p = (char *)malloc(1024); free(p); memcpy(p, "somedata"); // <--- VERY BAD!!!
botman
botman
View Public Profile
Visit botman's homepage!
Find More Posts by botman