TRQ-3022. Fix a memory leak around the mom hierarchy.