Fix: char allocation

make sure to delete newly allocated chars.