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>
This commit is contained in:
Andreas Gruenbacher 2010-03-15 23:18:48 +01:00 committed by Junio C Hamano
parent 8da61a2ab4
commit 730b020030

View File

@ -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");