tests: refs::iterator: fix memory leak due to ref names not being free'd The test refs::iterator::foreach_name iterates through every reference and copies its name into a local vector. While the test makes sure to free the vector afterwards, the copied reference names are not being free'd. Fix that.
diff --git a/tests/refs/iterator.c b/tests/refs/iterator.c
index 56f6ce5..18e9d1d 100644
--- a/tests/refs/iterator.c
+++ b/tests/refs/iterator.c
@@ -213,6 +213,7 @@ void test_refs_iterator__foreach_name(void)
git_vector_foreach(&output, i, name) {
cl_assert(refnames[i] != NULL);
cl_assert_equal_s(refnames[i], name);
+ git__free(name);
}
git_vector_free(&output);