提交 730b0200 编写于 作者: A Andreas Gruenbacher 提交者: Junio C Hamano

fetch: Fix minor memory leak

A temporary struct ref is allocated in store_updated_refs() but not
freed.
Signed-off-by: NAndreas Gruenbacher <agruen@suse.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 8da61a2a
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册