提交 2653a8c6 编写于 作者: N Nguyễn Thái Ngọc Duy 提交者: Junio C Hamano

dir.c: clean the entire struct in clear_exclude_list()

Make sure "el" can be reuseable again. The problem was el->alloc is
not cleared and may cause segfaults next time because add_exclude()
thinks el->excludes (being NULL) has enough space. Just clear the
entire struct to be safe.
Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 441c4a40
......@@ -501,9 +501,7 @@ void clear_exclude_list(struct exclude_list *el)
free(el->excludes);
free(el->filebuf);
el->nr = 0;
el->excludes = NULL;
el->filebuf = NULL;
memset(el, 0, sizeof(*el));
}
static void trim_trailing_spaces(char *buf)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册