diff options
author | Arthur Schreiber <schreiber.arthur@googlemail.com> | 2013-06-24 21:02:42 +0200 |
---|---|---|
committer | Arthur Schreiber <schreiber.arthur@googlemail.com> | 2013-06-24 21:02:42 +0200 |
commit | 8c510b8313bd933e6d3b44f3ce88999d349a8dd7 (patch) | |
tree | af67c68e45fc091f76823db46d33973d7df70438 /src/transports | |
parent | 353a90bedb6e679306f740fd0c1a08fc7934fbaa (diff) | |
download | libgit2-8c510b8313bd933e6d3b44f3ce88999d349a8dd7.tar.gz |
Fix a leak in the local transport code.
Diffstat (limited to 'src/transports')
-rw-r--r-- | src/transports/local.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/transports/local.c b/src/transports/local.c index 4bf1c876a..550060958 100644 --- a/src/transports/local.c +++ b/src/transports/local.c @@ -571,6 +571,8 @@ static void local_cancel(git_transport *transport) static int local_close(git_transport *transport) { transport_local *t = (transport_local *)transport; + size_t i; + git_remote_head *head; t->connected = 0; @@ -584,25 +586,23 @@ static int local_close(git_transport *transport) t->url = NULL; } + git_vector_foreach(&t->refs, i, head) { + git__free(head->name); + git__free(head); + } + + git_vector_free(&t->refs); + return 0; } static void local_free(git_transport *transport) { transport_local *t = (transport_local *)transport; - size_t i; - git_remote_head *head; /* Close the transport, if it's still open. */ 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 */ git__free(t); } |