metrics: fix memory leaks in unittest.

This fixes the memory leaks exposed in unittest.

BUG=chromium:408309
TEST=USE="clang asan" FEATURES="test" emerge-amd64-generic metrics
   passes.

Change-Id: I6f612499d7e67fa9171b95de4dbfac4e7f6698a0
Reviewed-on: https://chromium-review.googlesource.com/215887
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
4 files changed
tree: 25ada69c6756653866fb48fcedba385a54e3fd90
  1. metrics/