View Single Post
Re: crash in malloc() ?
Old
  (#4)
KickBot
Member
 
Status: Offline
Posts: 17
Join Date: Apr 2004
Default Re: crash in malloc() ? - 08-04-2004

Shouldn't the paths variable be declared as "struct PATH" instead of just "PATH"? Unless you have made a "typedef struct PATH PATH" somewhere?

Also do a malloc(sizeof(struct PATH)) instead of malloc(sizeof(PATH)).

Because I think it's compiler dependant. Some compilers will take "PATH" as meaning "struct PATH" others as something like "struct PATH *".

I had also some weird malloc() erros sometimes and this always happened because I had bad memory access elsewhere in the program, not necessary where the malloc is used.

Good luck!
  
Reply With Quote