diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2010-03-15 23:18:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-20 09:28:48 -0700 |
commit | 730b02003070400a82ff89b240573765d71e839a (patch) | |
tree | 68dd7258ae05dd980ef0d192a307046d7e0f3a6f | |
parent | fetch: Future-proof initialization of a refspec on stack (diff) | |
download | tgif-730b02003070400a82ff89b240573765d71e839a.tar.xz |
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>
-rw-r--r-- | builtin-fetch.c | 5 |
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"); |