I think a real fix would be to do `ret = xstrdup(part)` instead — this way we will keep the loop logic intact. Can you please do that?