fix memory leaks for the case described in #3 (strings in array of structures)