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:
authorAndreas Gruenbacher <agruen@suse.de>2010-03-16 01:18:48 +0300
committerJunio C Hamano <gitster@pobox.com>2010-03-20 19:28:48 +0300
commit730b02003070400a82ff89b240573765d71e839a (patch)
tree68dd7258ae05dd980ef0d192a307046d7e0f3a6f /builtin-fetch.c
parent8da61a2ab48175526390233c8bcedf63a3cdb6c4 (diff)
fetch: Fix minor memory leak
A temporary struct ref is allocated in store_updated_refs() but not freed. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fetch.c')
-rw-r--r--builtin-fetch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 8dd1adf849..bbc425b655 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -387,9 +387,10 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
fputc(url[i], fp);
fputc('\n', fp);
- if (ref)
+ if (ref) {
rc |= update_local_ref(ref, what, note);
- else
+ free(ref);
+ } else
sprintf(note, "* %-*s %-*s -> FETCH_HEAD",
SUMMARY_WIDTH, *kind ? kind : "branch",
REFCOL_WIDTH, *what ? what : "HEAD");