Fixed the leak detected by valgrind test 'all_entities_with_emptyType.test'