Fixing a memory leak in a test and a dubious prototype by the same go