Commit 8c510b83 by Arthur Schreiber

Fix a leak in the local transport code.

parent 353a90be
...@@ -571,6 +571,8 @@ static void local_cancel(git_transport *transport) ...@@ -571,6 +571,8 @@ static void local_cancel(git_transport *transport)
static int local_close(git_transport *transport) static int local_close(git_transport *transport)
{ {
transport_local *t = (transport_local *)transport; transport_local *t = (transport_local *)transport;
size_t i;
git_remote_head *head;
t->connected = 0; t->connected = 0;
...@@ -584,25 +586,23 @@ static int local_close(git_transport *transport) ...@@ -584,25 +586,23 @@ static int local_close(git_transport *transport)
t->url = NULL; t->url = NULL;
} }
git_vector_foreach(&t->refs, i, head) {
git__free(head->name);
git__free(head);
}
git_vector_free(&t->refs);
return 0; return 0;
} }
static void local_free(git_transport *transport) static void local_free(git_transport *transport)
{ {
transport_local *t = (transport_local *)transport; transport_local *t = (transport_local *)transport;
size_t i;
git_remote_head *head;
/* Close the transport, if it's still open. */ /* Close the transport, if it's still open. */
local_close(transport); local_close(transport);
git_vector_foreach(&t->refs, i, head) {
git__free(head->name);
git__free(head);
}
git_vector_free(&t->refs);
/* Free the transport */ /* Free the transport */
git__free(t); git__free(t);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment