Merge "Fix UAF in metrics summarizer code"