refs loose_lookup: also free the buffer on success Free the ref_file buffer at the end of the function also on success. This fixes a small memory leak.
diff --git a/src/refs.c b/src/refs.c
index 40b80ec..8e29655 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -333,6 +333,7 @@ static int loose_lookup(
ref->mtime = ref_time;
*ref_out = ref;
+ gitfo_free_buf(&ref_file);
return GIT_SUCCESS;
cleanup: