提交 d64d6c9f 编写于 作者: A Alexandre Julliard 提交者: Junio C Hamano

get_shallow_commits: Avoid memory leak if a commit has been reached already.

Signed-off-by: NAlexandre Julliard <julliard@winehq.org>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 d1586315
......@@ -60,7 +60,9 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
commit = NULL;
continue;
}
commit->util = xcalloc(1, sizeof(int));
if (!commit->util)
commit->util = xmalloc(sizeof(int));
*(int *)commit->util = 0;
cur_depth = 0;
} else {
commit = (struct commit *)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册