[android-developers] Re: SIGSEGV on free()

2011-03-23 Thread Hari Edo
This has nothing to do with Android, per se. Calling free(x) when x is NULL is not harmful. Calling free(x) when x came from malloc() is not harmful. Calling free(x) twice with the same value of x will surely SIGSEGV. Calling free(x) with a bad value will likely SIGSEGV. Note case 3: if you

Re: [android-developers] Re: SIGSEGV on free()

2011-03-23 Thread Dewr
thank you guys. I really appreciate your advice. I have debugged by putting this 1 line code right after free(strBuf); (though there is no repeating free(strBuf)...) strBuf = NULL; thank you! :D 2011/3/24 Hari Edo hari@gmail.com This has nothing to do with Android, per se. Calling

[android-developers] Re: SIGSEGV on free()

2011-03-23 Thread Hari Edo
On Mar 23, 11:41 pm, Dewr wind8...@gmail.com wrote: thank you guys. I really appreciate your advice. I have debugged by putting this 1 line code right after free(strBuf); (though there is no repeating free(strBuf)...) strBuf = NULL; If that's all that you changed, and it fixed the

[android-developers] Re: SIGSEGV on free()

2011-03-22 Thread ip332
The error usually indicates allocated memory overrun somewhere in the past. IMHO you use strlen() on UTF8 string therefore the strcpy() overwrites the amount of memory allocated by malloc. Increase the allocation size 5 times to check this theory - if the problem has gone then you need to review