[H-GEN] malloc() causing a segfault
Nikolai Lusan
nikolai at humbug.org.au
Wed Aug 30 23:18:35 EDT 2000
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Please observe the list's charter. ]
Hey coders,
I'm doing some C and came across a situation where I keep getting
a segfault while proccessing a file. I traced it doen to this:
char *tmp;
tmp = (char *) malloc(sizeof(char) * 1025);
<SNIP>
free(tmp);
The odd this is this code is part of a proccedure that can run a hundred
time with no problems, the exact fault occurs with the malloc and a
debugger gives "0x40065c06 in free () from /lib/libc.so.6". Personally I
have no Idea why this is happening, and it has been eating me all
morning.
If anyone coul help I would appriciate it greatly. :)
Nikolai
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.
More information about the General
mailing list