Merge "endpoint snapshot: avoid second cleanup on alloc failure"