spec coverage: fix memory ownership issue