Stricter memory management in get_good_sections.