Fix a memory corruption bug while collecting bridge stats