I did a simple change in my code so that the release version is now working with no problem.

In fact I was allocating a block of n bytes, reading a buffer of n bytes and writing a null character at position n. Now I allocated a block of n+1 bytes.

My application still blocks (second problem), so if someone could help me with this it would be great.

Thanks