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

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-06-09 05:13:39 +0400
committerJunio C Hamano <gitster@pobox.com>2011-06-09 05:13:39 +0400
commitd64a09fe223cec5535aec246dba87ec24d0158bb (patch)
tree9187683f78578db24426f31e46e2c80ae7b287c1
parent8fba5f985263efd46e94f392ce618de6adc1c3d5 (diff)
parentd8ead15963890a42f99fd0e7f3192b55cacd9404 (diff)
Merge branch 'maint'
* maint: fetch: do not leak a refspec
-rw-r--r--builtin/fetch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index f9c41da475..93c99385a9 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -875,6 +875,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
{
int i;
static const char **refs = NULL;
+ struct refspec *refspec;
int ref_nr = 0;
int exit_code;
@@ -915,8 +916,9 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
sigchain_push_common(unlock_pack_on_signal);
atexit(unlock_pack);
- exit_code = do_fetch(transport,
- parse_fetch_refspec(ref_nr, refs), ref_nr);
+ refspec = parse_fetch_refspec(ref_nr, refs);
+ exit_code = do_fetch(transport, refspec, ref_nr);
+ free(refspec);
transport_disconnect(transport);
transport = NULL;
return exit_code;