Commit 1c967df3 by Carlos Martín Nieto

remote: fix a couple of leaks

parent 359dce72
...@@ -72,7 +72,10 @@ static int filter_wants(git_remote *remote) ...@@ -72,7 +72,10 @@ static int filter_wants(git_remote *remote)
if ((error = git_refspec__parse(&head, "HEAD", true)) < 0) if ((error = git_refspec__parse(&head, "HEAD", true)) < 0)
goto cleanup; goto cleanup;
if ((error = git_refspec__dwim_one(&remote->active_refspecs, &head, &remote->refs)) < 0) error = git_refspec__dwim_one(&remote->active_refspecs, &head, &remote->refs);
git_refspec__free(&head);
if (error < 0)
goto cleanup; goto cleanup;
} }
......
...@@ -726,9 +726,6 @@ int git_remote_download(git_remote *remote) ...@@ -726,9 +726,6 @@ int git_remote_download(git_remote *remote)
assert(remote); assert(remote);
if (git_vector_init(&refs, 8, remote_head_cmp) < 0)
return -1;
if (git_remote_ls((const git_remote_head ***)&refs.contents, &refs.length, remote) < 0) if (git_remote_ls((const git_remote_head ***)&refs.contents, &refs.length, remote) < 0)
return -1; return -1;
...@@ -983,9 +980,6 @@ int git_remote_update_tips(git_remote *remote) ...@@ -983,9 +980,6 @@ int git_remote_update_tips(git_remote *remote)
if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0) if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0)
return -1; return -1;
if (git_vector_init(&refs, 16, NULL) < 0)
return -1;
if ((error = git_remote_ls((const git_remote_head ***)&refs.contents, &refs.length, remote)) < 0) if ((error = git_remote_ls((const git_remote_head ***)&refs.contents, &refs.length, remote)) < 0)
goto out; goto out;
......
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