summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2018-10-04 10:07:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-05 05:48:21 (GMT)
commit47cb16a26447b32f5440c3a109ad5f16a5f735bd (patch)
treee2d430245b2613a0e33abb817a3d376b12ca8d5b /diff.c
parent9c1a6c2bf8375a6652fd98439438e92626a00167 (diff)
downloadgit-47cb16a26447b32f5440c3a109ad5f16a5f735bd.zip
git-47cb16a26447b32f5440c3a109ad5f16a5f735bd.tar.gz
git-47cb16a26447b32f5440c3a109ad5f16a5f735bd.tar.bz2
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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index e0ebddf..c29b1cc 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++)