Commit 567fc1d20c734c34dd1c4c19be12abcc1622aa5d

Carlos Martín Nieto 2011-03-22T12:47:53

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.

1
2
3
4
5
6
7
8
9
10
11
12
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: