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!
|