From 47cb16a26447b32f5440c3a109ad5f16a5f735bd Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Thu, 4 Oct 2018 11:07:45 +0100 Subject: [PATCH] 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: Phillip Wood Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index e0ebddfac9..c29b1cce14 100644 --- a/diff.c +++ b/diff.c @@ -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++) -- GitLab