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 <phillip.wood@dunelm.org.uk>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Phillip Wood 2018-10-04 11:07:45 +01:00 committed by Junio C Hamano
parent 9c1a6c2bf8
commit 47cb16a264

4
diff.c
View File

@ -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++)