asan shows a leak in MakePathEnds1::visitPathEnd of
PathEnd *copy = path_end->copy();
This happens because you use:
When group occurs more than once the previous value is leaked. I put some debug code here that verifies this does occur in the else branch with that attached test case.
if (ends_.find(group) != ends_.end()) {
printf("BAD\n");
exit(1);
}
bug.zip