mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 12:57:05 +00:00
Merge pull request #1675 from arthurschreiber/fix-leak-in-local-transport
Fix a leak in the local transport code.
This commit is contained in:
commit
5b4a70836a
@ -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,18 +586,6 @@ static int local_close(git_transport *transport)
|
||||
t->url = NULL;
|
||||
}
|
||||
|
||||
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);
|
||||
@ -603,6 +593,16 @@ static void local_free(git_transport *transport)
|
||||
|
||||
git_vector_free(&t->refs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void local_free(git_transport *transport)
|
||||
{
|
||||
transport_local *t = (transport_local *)transport;
|
||||
|
||||
/* Close the transport, if it's still open. */
|
||||
local_close(transport);
|
||||
|
||||
/* Free the transport */
|
||||
git__free(t);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user