n****l 发帖数: 1739 | 1 well, i have this strange problem when playing with gcc.
in my c main program:
int main()
{
.......
char *out_str;
out_str=(char *)malloc(strlen(in_str));
............
free(out_str); <----- when add this get core dump
return 0;
}
when run this problem, got following error:
*** Error in `./a.out': free(): invalid next size (fast): 0x09684008 ***
if remove free(), then no problem. what is the issue here? looks like
a double free? but i did not free the out_str anyway in the code. |
|