提交 47cb16a2 编写于 作者: P Phillip Wood 提交者: Junio C Hamano

diff --color-moved: fix a memory leak

Free the hashmap items as well as the hashmap itself. This was found
with asan.
Signed-off-by: NPhillip Wood <phillip.wood@dunelm.org.uk>
Reviewed-by: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 9c1a6c2b
......@@ -5852,8 +5852,8 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)
if (o->color_moved == COLOR_MOVED_ZEBRA_DIM)
dim_moved_lines(o);
hashmap_free(&add_lines, 0);
hashmap_free(&del_lines, 0);
hashmap_free(&add_lines, 1);
hashmap_free(&del_lines, 1);
}
for (i = 0; i < esm.nr; i++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册