From: Phillip Wood Date: Thu, 4 Oct 2018 10:07:45 +0000 (+0100) Subject: diff --color-moved: fix a memory leak X-Git-Tag: v2.20.0-rc0~153^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47cb16a26447b32f5440c3a109ad5f16a5f735bd;p=thirdparty%2Fgit.git 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 --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++)