No optreset on Linux.
Fix snprintf buffer size.
Free memory.