Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-10-13 23:00:45 +0400
committernulltoken <emeric.fermas@gmail.com>2012-10-15 22:41:43 +0400
commit68206c54bf98f36725d21e7f7efee9f3af68d259 (patch)
tree8c8acd9fa3a5de6ecc051014ecb7c2dc81b7b04a /src/fetch.c
parentfa5d94a0d4d9bbdd167443f052ad4f1f11541aae (diff)
test: fix some memory leaks
Diffstat (limited to 'src/fetch.c')
-rw-r--r--src/fetch.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fetch.c b/src/fetch.c
index f9cc8aae1..737a1b4cb 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -58,10 +58,11 @@ static int filter_wants(git_remote *remote)
{
struct filter_payload p;
git_refspec tagspec;
+ int error = -1;
git_vector_clear(&remote->refs);
if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0)
- return -1;
+ return error;
/*
* The fetch refspec can be NULL, and what this means is that the
@@ -75,9 +76,14 @@ static int filter_wants(git_remote *remote)
p.remote = remote;
if (git_repository_odb__weakptr(&p.odb, remote->repo) < 0)
- return -1;
+ goto cleanup;
+
+ error = git_remote_ls(remote, filter_ref__cb, &p);
+
+cleanup:
+ git_refspec__free(&tagspec);
- return git_remote_ls(remote, filter_ref__cb, &p);
+ return error;
}
/* Wait until we get an ack from the */