Catch and handle more strings memory errors

Enable some compiler warning to easily check memory error problems.
Fix some memory errors caused by out of memory conditions.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>