C memory corruption
I’m learning C, using C99, and there is some memory allocation that is corrupting the application that i’m failing to understand. In the function below the code is allocating 27 bytes and free-ing it before return. the purpose of the function is to receive a ASCII string and write as UTF-8. It is all working fine, but the free
call complains.