Fix access of an already freed memory.