Fix memory leak in test

Authored by gladhorn on Jul 27 2018, 1:47 PM.