Commit 9728cfde5f3685cb11302560a67754104d618ea2

Arthur Schreiber 2013-06-25T11:17:55

Make sure we don't leak memory again.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/transports/local.c b/src/transports/local.c
index 2a85e95..a9da814 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -599,6 +599,13 @@ static int local_close(git_transport *transport)
 static void local_free(git_transport *transport)
 {
 	transport_local *t = (transport_local *)transport;
+	size_t i;
+	git_remote_head *head;
+
+	git_vector_foreach(&t->refs, i, head) {
+		git__free(head->name);
+		git__free(head);
+	}
 
 	git_vector_free(&t->refs);