summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c50b2b4)
raw | patch | inline | side by side (parent: c50b2b4)
author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 3 Mar 2008 02:35:10 +0000 (21:35 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Mar 2008 08:05:45 +0000 (00:05 -0800) |
To support calling find_non_local_tags() more than once in a single
git-fetch process we need the existing_refs to be stack-allocated
so it resets on the second call. We also should free the path
lists to avoid unnecessary memory leaking.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-fetch process we need the existing_refs to be stack-allocated
so it resets on the second call. We also should free the path
lists to avoid unnecessary memory leaking.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 1d3ce775ab48e5f73eaa5cb7977ce3e4c1af1881..3758d4817e2f418d971715426e8d6a956bfae5a9 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
struct ref **head,
struct ref ***tail)
{
- static struct path_list existing_refs = { NULL, 0, 0, 0 };
+ struct path_list existing_refs = { NULL, 0, 0, 0 };
struct path_list new_refs = { NULL, 0, 0, 1 };
char *ref_name;
int ref_name_len;
}
free(ref_name);
}
+ path_list_clear(&existing_refs, 0);
+ path_list_clear(&new_refs, 0);
}
static int do_fetch(struct transport *transport,